Commit 81906085 authored by Izol's avatar Izol

update version SS.10.WWW

release note :

menambahkan maksimal wristband berbeda ke konfigurasi
merubah sebgaian tampilan konfigurasi
menambahkan loading di tap wristband
parent 760af146
# self_service_3 # self_service_3
A new Flutter project. A new Flutter project Self Service.
## Getting Started ## Getting Started
This project is a starting point for a Flutter application. This project is a starting point for a Flutter application.
A few resources to get you started if this is your first Flutter project:
- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
For help getting started with Flutter development, view the
[online documentation](https://docs.flutter.dev/), which offers tutorials,
samples, guidance on mobile development, and a full API reference.
sdk.dir=/Users/macbookpro/Library/Android/sdk sdk.dir=/Users/macbookpro/Library/Android/sdk
flutter.sdk=/Users/macbookpro/Developer/flutter flutter.sdk=/Users/macbookpro/Developer/flutter
flutter.buildMode=debug flutter.buildMode=debug
flutter.versionName=SS.9.WWW flutter.versionName=SS.10.WWW
flutter.versionCode=2 flutter.versionCode=3
\ No newline at end of file \ No newline at end of file
...@@ -14,6 +14,7 @@ TextEditingController urlPrePaidController = TextEditingController(text: Prefere ...@@ -14,6 +14,7 @@ TextEditingController urlPrePaidController = TextEditingController(text: Prefere
TextEditingController maxControlller = TextEditingController(text: PreferencesHelper.getString(kMax)); TextEditingController maxControlller = TextEditingController(text: PreferencesHelper.getString(kMax));
TextEditingController minController = TextEditingController(text: PreferencesHelper.getString(kMin)); TextEditingController minController = TextEditingController(text: PreferencesHelper.getString(kMin));
TextEditingController idleController = TextEditingController(text: PreferencesHelper.getString(kIdle)); TextEditingController idleController = TextEditingController(text: PreferencesHelper.getString(kIdle));
TextEditingController maxTapController = TextEditingController(text: PreferencesHelper.getString(kMaxTap));
TextEditingController validate = TextEditingController(text: PreferencesHelper.getString(kUserData)); TextEditingController validate = TextEditingController(text: PreferencesHelper.getString(kUserData));
TextEditingController? amountController = TextEditingController(text: ''); TextEditingController? amountController = TextEditingController(text: '');
TextEditingController outletName = TextEditingController(text: ''); TextEditingController outletName = TextEditingController(text: '');
...@@ -12,6 +12,7 @@ const kVersionApp = "version_app"; ...@@ -12,6 +12,7 @@ const kVersionApp = "version_app";
const kMax = "max"; const kMax = "max";
const kMin = "min"; const kMin = "min";
const kIdle ="idle"; const kIdle ="idle";
const kMaxTap = "maxTap";
const kMultiOutletName = "multioutletname"; const kMultiOutletName = "multioutletname";
const kMultiOutletServiceCharge = "multioutletservicecharge"; const kMultiOutletServiceCharge = "multioutletservicecharge";
// const kVersionApp = "version_app"; // const kVersionApp = "version_app";
......
...@@ -5,6 +5,7 @@ import 'dart:async'; ...@@ -5,6 +5,7 @@ import 'dart:async';
import 'dart:io'; import 'dart:io';
import 'dart:math'; import 'dart:math';
import 'dart:ui'; import 'dart:ui';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:awesome_dialog/awesome_dialog.dart'; import 'package:awesome_dialog/awesome_dialog.dart';
import 'package:otp_text_field/otp_field.dart'; import 'package:otp_text_field/otp_field.dart';
...@@ -79,7 +80,13 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback { ...@@ -79,7 +80,13 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
late Timer? timer; late Timer? timer;
bool isShowingDialog = false; bool isShowingDialog = false;
late ConnectivityResult _connectivityResult; late ConnectivityResult _connectivityResult;
late Color _statusColor = Colors.grey; Color _statusColor1 = Colors.grey;
Color _statusColor2 = Colors.grey;
Color _statusColor3 = Colors.grey;
Color _tapColor1 = Colors.grey;
Color _tapColor2 = Colors.grey;
Color _tapColor3 = Colors.grey;
int _activeContainerIndex = 1;
double _downloadSpeed = 0; double _downloadSpeed = 0;
var infoCard, var infoCard,
...@@ -154,20 +161,49 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback { ...@@ -154,20 +161,49 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
setState(() { setState(() {
_connectivityResult = connectivityResult; _connectivityResult = connectivityResult;
if (_connectivityResult == ConnectivityResult.none) { if (_connectivityResult == ConnectivityResult.none) {
_statusColor = Colors.red; _statusColor1 = Colors.red;
_downloadSpeed = _statusColor2 = Colors.grey;
0; // set download speed to 0 when there is no internet connection _statusColor3 = Colors.grey;
_activeContainerIndex = 1;
_downloadSpeed = 0;
} else if (_connectivityResult == ConnectivityResult.mobile || } else if (_connectivityResult == ConnectivityResult.mobile ||
_connectivityResult == ConnectivityResult.wifi) { _connectivityResult == ConnectivityResult.wifi) {
_statusColor = Colors.green; _changeColor();
_checkInternetSpeed(); // call _checkInternetSpeed function when there is internet connection _checkInternetSpeed(); // call _checkInternetSpeed function when there is internet connection
} else { } else {
_statusColor = Colors.yellow; _statusColor1 = Colors.grey;
_statusColor2 = Colors.yellow;
_statusColor3 = Colors.grey;
_activeContainerIndex = 2;
} }
}); });
} }
void _changeColor() {
if (_activeContainerIndex == 1) {
setState(() {
_statusColor1 = Colors.green;
_statusColor2 = Colors.grey;
_statusColor3 = Colors.grey;
_activeContainerIndex = 2;
});
} else if (_activeContainerIndex == 2) {
setState(() {
_statusColor1 = Colors.grey;
_statusColor2 = Colors.yellow;
_statusColor3 = Colors.grey;
_activeContainerIndex = 3;
});
} else if (_activeContainerIndex == 3) {
setState(() {
_statusColor1 = Colors.grey;
_statusColor2 = Colors.grey;
_statusColor3 = Colors.green;
_activeContainerIndex = 1;
});
}
}
Future<void> _checkInternetSpeed() async { Future<void> _checkInternetSpeed() async {
final connectivityResult = await Connectivity().checkConnectivity(); final connectivityResult = await Connectivity().checkConnectivity();
if (connectivityResult == ConnectivityResult.none) { if (connectivityResult == ConnectivityResult.none) {
...@@ -571,6 +607,7 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback { ...@@ -571,6 +607,7 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
countMax += 1; countMax += 1;
infoCard = info; infoCard = info;
var infoMap = jsonDecode(info); var infoMap = jsonDecode(info);
String nilaiTap = PreferencesHelper.getString('maxTap');
String newCardNumber = infoMap["cardNumber"]; String newCardNumber = infoMap["cardNumber"];
if (newCardNumber == cardNumber) { if (newCardNumber == cardNumber) {
topUpBalance(approvalCode); topUpBalance(approvalCode);
...@@ -587,7 +624,7 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback { ...@@ -587,7 +624,7 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
"Cards are not the same! please put the previous card ${countMax}", "Cards are not the same! please put the previous card ${countMax}",
btnOkOnPress: () async { btnOkOnPress: () async {
if (timer != null) timer?.cancel(); if (timer != null) timer?.cancel();
if (countMax < 3) { if (countMax < int.parse(nilaiTap)) {
tapBalance(); tapBalance();
} else { } else {
AwesomeDialog( AwesomeDialog(
...@@ -843,20 +880,6 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback { ...@@ -843,20 +880,6 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
}); });
} }
// void tapIdle() {
// timer = Timer.periodic(Duration(seconds: int.parse(idle)), (timer) {
// print("ini pesan waktu idle : $idle");
// print("isShowingdialog : $isShowingDialog");
// if (!isShowingDialog) {
// isShowingDialog = true;
// timer?.cancel();
// _showTap();
// tapDial();
// }
// });
// }
void tapDial() async { void tapDial() async {
Future.delayed(const Duration(milliseconds: 500), () async { Future.delayed(const Duration(milliseconds: 500), () async {
var isTap = await StartService.getCard(); var isTap = await StartService.getCard();
...@@ -870,19 +893,6 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback { ...@@ -870,19 +893,6 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
}); });
} }
// void tapBalance() async {
// Future.delayed(const Duration(milliseconds: 500), () async {
// var isTap = await StartService.getCard();
// try {
// var infoMap = jsonDecode(isTap);
// _getInfoBeforeTopup(isTap);
// } catch (e) {
// print("Error $isTap");
// tapBalance();
// }
// });
// }
void tapBalance() async { void tapBalance() async {
Future.delayed(const Duration(milliseconds: 500), () async { Future.delayed(const Duration(milliseconds: 500), () async {
var isTap = await StartService.getCard(); var isTap = await StartService.getCard();
...@@ -1011,6 +1021,30 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback { ...@@ -1011,6 +1021,30 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
), ),
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
SizedBox(height: 20,),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SpinKitDoubleBounce(
color: Colors.greenAccent,
size: 20,
duration: const Duration(milliseconds: 1000),
),
SizedBox(width: 20),
SpinKitDoubleBounce(
color: Colors.blueAccent,
size: 20,
duration: const Duration(milliseconds: 2000),
),
SizedBox(width: 20),
SpinKitDoubleBounce(
color: Colors.redAccent,
size: 20,
duration: const Duration(milliseconds: 3000),
),
],
),
], ],
), ),
], ],
...@@ -1050,13 +1084,13 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback { ...@@ -1050,13 +1084,13 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
children: <Widget>[ children: <Widget>[
Container( Container(
width: 1000, width: 1000,
height: 380, height: 390,
child: Column( child: Column(
children: [ children: [
Image.asset( Image.asset(
"assets/wristband.gif", "assets/wristband.gif",
width: 300, width: 280,
height: 300, height: 280,
), ),
Text( Text(
success, success,
...@@ -1077,6 +1111,29 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback { ...@@ -1077,6 +1111,29 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
), ),
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
SizedBox(height: 10,),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SpinKitDoubleBounce(
color: Colors.redAccent,
size: 20,
duration: const Duration(milliseconds: 3000),
),
SizedBox(width: 20),
SpinKitDoubleBounce(
color: Colors.blueAccent,
size: 20,
duration: const Duration(milliseconds: 2000),
),
SizedBox(width: 20),
SpinKitDoubleBounce(
color: Colors.greenAccent,
size: 20,
duration: const Duration(milliseconds: 1000),
),
],
),
], ],
), ),
), ),
...@@ -2425,7 +2482,7 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback { ...@@ -2425,7 +2482,7 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
children: [ children: [
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: _statusColor, color: Colors.blue,
shape: BoxShape.circle, shape: BoxShape.circle,
), ),
width: 12, width: 12,
......
...@@ -77,6 +77,7 @@ class _SetMerchantState extends State<SetMerchant> { ...@@ -77,6 +77,7 @@ class _SetMerchantState extends State<SetMerchant> {
String max = maxControlller.text; String max = maxControlller.text;
String min = minController.text; String min = minController.text;
String idle = idleController.text; String idle = idleController.text;
String maxTap = maxTapController.text;
if (urlDolan.isNotEmpty && if (urlDolan.isNotEmpty &&
urlCloseLoop.isNotEmpty && urlCloseLoop.isNotEmpty &&
...@@ -108,6 +109,7 @@ class _SetMerchantState extends State<SetMerchant> { ...@@ -108,6 +109,7 @@ class _SetMerchantState extends State<SetMerchant> {
PreferencesHelper.setString(kMin, min.replaceAll(",","")); PreferencesHelper.setString(kMin, min.replaceAll(",",""));
PreferencesHelper.setString(kIdle, idle); PreferencesHelper.setString(kIdle, idle);
PreferencesHelper.setString(kMaxTap, maxTap);
PreferencesHelper.setBool(kIsDoneConfig, true); PreferencesHelper.setBool(kIsDoneConfig, true);
...@@ -209,6 +211,17 @@ class _SetMerchantState extends State<SetMerchant> { ...@@ -209,6 +211,17 @@ class _SetMerchantState extends State<SetMerchant> {
), ),
), ),
), ),
SizedBox(height: 20),
Text('URL/HOST/TREND : ${urlDolanController.text}'),
Text('URL/HOST/DOLAN : ${urlCloseLoopController.text}'),
Text('URL/HOST/PREPAID : ${urlPrePaidController.text}'),
Text('URL/HOST/QRIS/CORE/PAYMENT : ${urlCorePaymentController.text}'),
Text('NAMA/GERAI : ${merchantNameController.text}'),
Text('NAMA/PENGGUNA : ${userNameController.text}'),
Text('MAX/ISIULANG/TOPUP : ${maxControlller.text}'),
Text('MIN/ISIULANG/TOPUP : ${minController.text}'),
Text('IDLE/PERDETIK : ${idleController.text}'),
Text('MAX/TAP/TOPUP : ${maxTapController.text}'),
], ],
), ),
), ),
...@@ -296,82 +309,86 @@ class _SetMerchantState extends State<SetMerchant> { ...@@ -296,82 +309,86 @@ class _SetMerchantState extends State<SetMerchant> {
context: context, context: context,
builder: (BuildContext context) => Center( builder: (BuildContext context) => Center(
child: SingleChildScrollView( child: SingleChildScrollView(
physics: AlwaysScrollableScrollPhysics(),
child: Center( child: Center(
child: SingleChildScrollView( child: SingleChildScrollView(
physics: AlwaysScrollableScrollPhysics(),
child: AlertDialog( child: AlertDialog(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30)), borderRadius: BorderRadius.circular(30)),
title: Center(), title: Center(),
content: SizedBox(
width: 500,
child: Row(
children: <Widget>[
],
),
),
actions: <Widget>[ actions: <Widget>[
Column( Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [],
),
Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Text(
TyperAnimatedTextKit( "Konfigurasi Self-Service !",
text: const [
"silakan isi form di bawah ini !",
],
textStyle: TextStyle(
fontSize: 20,
fontWeight: bold,
color:blackColor,
),
repeatForever: true,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
color: blackColor,
), ),
],
),
const SizedBox(
height: 20,
), ),
SizedBox(height: 20),
SingleChildScrollView(
physics: AlwaysScrollableScrollPhysics(),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Expanded(
child: Column(
children: [
CustomFormField( CustomFormField(
controller: urlDolanController, controller: urlDolanController,
title: '( Url Host Trend )', title: 'Url Host Trend',
isShowTitle: false, validator: (value) { }, isShowTitle: false,
), validator: (value) {},
const SizedBox(
height: 20,
), ),
SizedBox(height: 20),
CustomFormField( CustomFormField(
controller: urlCloseLoopController, controller: urlCloseLoopController,
title: '( Url Host Dolan )', title: 'Url Host Dolan',
isShowTitle: false, validator: (value) { }, isShowTitle: false,
), validator: (value) {},
const SizedBox(
height: 20,
), ),
SizedBox(height: 20),
CustomFormField( CustomFormField(
controller: urlPrePaidController, controller: urlPrePaidController,
title: '( Url Host Prepaid )', title: 'Url Host Prepaid',
isShowTitle: false, validator: (value) { }, isShowTitle: false,
validator: (value) {},
), ),
const SizedBox( SizedBox(height: 20),
height: 20, CustomNumberField(
controller: maxControlller,
title: "Maksimal isi ulang topup",
isShowTitle: false,
), ),
SizedBox(height: 20),
CustomNumberField(
controller: minController,
title: "Minimal isi ulang topup",
isShowTitle: false,
),
],
),
),
SizedBox(width: 30,),
Expanded(
child: Column(
children: [
CustomFormField( CustomFormField(
controller: urlCorePaymentController, controller: urlCorePaymentController,
title: '( Url Core Payment )', title: 'Url Core Payment',
isShowTitle: false, isShowTitle: false,
validator: (value) { validator: (value) {
if (value!.isEmpty) { if (value!.isEmpty) {
return 'Please enter a URL'; return 'Please enter a URL';
} }
if (!value!.startsWith('http://') && !value.startsWith('https://')) { if (!value.startsWith('http://') &&
!value.startsWith('https://')) {
return 'Please enter a valid URL with http:// or https://'; return 'Please enter a valid URL with http:// or https://';
} }
if (!value.endsWith('.com')) { if (!value.endsWith('.com')) {
...@@ -380,45 +397,37 @@ class _SetMerchantState extends State<SetMerchant> { ...@@ -380,45 +397,37 @@ class _SetMerchantState extends State<SetMerchant> {
return null; return null;
}, },
), ),
const SizedBox( SizedBox(height: 20),
height: 20,
),
CustomFormField( CustomFormField(
controller: merchantNameController, controller: merchantNameController,
title: 'Nama gerai', title: 'Nama gerai',
isShowTitle: false, validator: (value) { }, isShowTitle: false,
), validator: (value) {},
const SizedBox(
height: 20,
), ),
SizedBox(height: 20),
CustomFormField( CustomFormField(
controller: userNameController, controller: userNameController,
title: 'Nama Pengguna', title: 'Nama Pengguna',
isShowTitle: false, validator: (value) { }, isShowTitle: false,
), validator: (value) {},
const SizedBox(
height:20,
), ),
SizedBox(height: 20),
CustomNumberField( CustomNumberField(
controller: maxControlller, controller: idleController,
title: "Maksimal isi ulang topup", title: "Waktu siaga beranda (detik)",
isShowTitle: false, isShowTitle: false,
), ),
const SizedBox( SizedBox(height: 20),
height: 20,
),
CustomNumberField( CustomNumberField(
controller: minController, controller: maxTapController,
title: "Minimal isi ulang topup", title: "Maksimal Tap Wristband Beda",
isShowTitle: false, isShowTitle: false,
), ),
const SizedBox( ],
height: 20, ),
),
],
), ),
CustomFormField(
controller: idleController,
title: "Waktu siaga beranda (detik)",
isShowTitle: false, validator: (value) { },
), ),
], ],
), ),
...@@ -442,6 +451,7 @@ class _SetMerchantState extends State<SetMerchant> { ...@@ -442,6 +451,7 @@ class _SetMerchantState extends State<SetMerchant> {
print('MAX/ISIULANG/TOPUP : ${maxControlller}'); print('MAX/ISIULANG/TOPUP : ${maxControlller}');
print('MIN/ISIULANG/TOPUP : ${minController}'); print('MIN/ISIULANG/TOPUP : ${minController}');
print('IDLE/PERDETIK : ${idleController}'); print('IDLE/PERDETIK : ${idleController}');
print('MAX/TAP/TOPUP : ${maxTapController}');
}); });
// setOutlet(); // setOutlet();
}, },
......
...@@ -52,6 +52,7 @@ dependencies: ...@@ -52,6 +52,7 @@ dependencies:
animated_text_kit: ^4.2.2 animated_text_kit: ^4.2.2
validators: ^3.0.0 validators: ^3.0.0
http: ^0.13.5 http: ^0.13.5
flutter_spinkit: ^5.1.0
simple_animations: ^5.0.0+2 simple_animations: ^5.0.0+2
flutter_svg: ^2.0.4 flutter_svg: ^2.0.4
flutter_layout_grid: ^2.0.1 flutter_layout_grid: ^2.0.1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment