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
A new Flutter project.
A new Flutter project Self Service.
## Getting Started
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
flutter.sdk=/Users/macbookpro/Developer/flutter
flutter.buildMode=debug
flutter.versionName=SS.9.WWW
flutter.versionCode=2
\ No newline at end of file
flutter.versionName=SS.10.WWW
flutter.versionCode=3
\ No newline at end of file
......@@ -14,6 +14,7 @@ TextEditingController urlPrePaidController = TextEditingController(text: Prefere
TextEditingController maxControlller = TextEditingController(text: PreferencesHelper.getString(kMax));
TextEditingController minController = TextEditingController(text: PreferencesHelper.getString(kMin));
TextEditingController idleController = TextEditingController(text: PreferencesHelper.getString(kIdle));
TextEditingController maxTapController = TextEditingController(text: PreferencesHelper.getString(kMaxTap));
TextEditingController validate = TextEditingController(text: PreferencesHelper.getString(kUserData));
TextEditingController? amountController = TextEditingController(text: '');
TextEditingController outletName = TextEditingController(text: '');
......@@ -12,6 +12,7 @@ const kVersionApp = "version_app";
const kMax = "max";
const kMin = "min";
const kIdle ="idle";
const kMaxTap = "maxTap";
const kMultiOutletName = "multioutletname";
const kMultiOutletServiceCharge = "multioutletservicecharge";
// const kVersionApp = "version_app";
......
......@@ -5,6 +5,7 @@ import 'dart:async';
import 'dart:io';
import 'dart:math';
import 'dart:ui';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:awesome_dialog/awesome_dialog.dart';
import 'package:otp_text_field/otp_field.dart';
......@@ -79,7 +80,13 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
late Timer? timer;
bool isShowingDialog = false;
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;
var infoCard,
......@@ -154,20 +161,49 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
setState(() {
_connectivityResult = connectivityResult;
if (_connectivityResult == ConnectivityResult.none) {
_statusColor = Colors.red;
_downloadSpeed =
0; // set download speed to 0 when there is no internet connection
_statusColor1 = Colors.red;
_statusColor2 = Colors.grey;
_statusColor3 = Colors.grey;
_activeContainerIndex = 1;
_downloadSpeed = 0;
} else if (_connectivityResult == ConnectivityResult.mobile ||
_connectivityResult == ConnectivityResult.wifi) {
_statusColor = Colors.green;
_changeColor();
_checkInternetSpeed(); // call _checkInternetSpeed function when there is internet connection
} 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 {
final connectivityResult = await Connectivity().checkConnectivity();
if (connectivityResult == ConnectivityResult.none) {
......@@ -571,6 +607,7 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
countMax += 1;
infoCard = info;
var infoMap = jsonDecode(info);
String nilaiTap = PreferencesHelper.getString('maxTap');
String newCardNumber = infoMap["cardNumber"];
if (newCardNumber == cardNumber) {
topUpBalance(approvalCode);
......@@ -587,7 +624,7 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
"Cards are not the same! please put the previous card ${countMax}",
btnOkOnPress: () async {
if (timer != null) timer?.cancel();
if (countMax < 3) {
if (countMax < int.parse(nilaiTap)) {
tapBalance();
} else {
AwesomeDialog(
......@@ -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 {
Future.delayed(const Duration(milliseconds: 500), () async {
var isTap = await StartService.getCard();
......@@ -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 {
Future.delayed(const Duration(milliseconds: 500), () async {
var isTap = await StartService.getCard();
......@@ -1011,6 +1021,30 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
),
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 {
children: <Widget>[
Container(
width: 1000,
height: 380,
height: 390,
child: Column(
children: [
Image.asset(
"assets/wristband.gif",
width: 300,
height: 300,
width: 280,
height: 280,
),
Text(
success,
......@@ -1077,6 +1111,29 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
),
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 {
children: [
Container(
decoration: BoxDecoration(
color: _statusColor,
color: Colors.blue,
shape: BoxShape.circle,
),
width: 12,
......
......@@ -77,6 +77,7 @@ class _SetMerchantState extends State<SetMerchant> {
String max = maxControlller.text;
String min = minController.text;
String idle = idleController.text;
String maxTap = maxTapController.text;
if (urlDolan.isNotEmpty &&
urlCloseLoop.isNotEmpty &&
......@@ -108,6 +109,7 @@ class _SetMerchantState extends State<SetMerchant> {
PreferencesHelper.setString(kMin, min.replaceAll(",",""));
PreferencesHelper.setString(kIdle, idle);
PreferencesHelper.setString(kMaxTap, maxTap);
PreferencesHelper.setBool(kIsDoneConfig, true);
......@@ -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> {
context: context,
builder: (BuildContext context) => Center(
child: SingleChildScrollView(
physics: AlwaysScrollableScrollPhysics(),
child: Center(
child: SingleChildScrollView(
physics: AlwaysScrollableScrollPhysics(),
child: AlertDialog(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30)),
title: Center(),
content: SizedBox(
width: 500,
child: Row(
children: <Widget>[
],
),
),
actions: <Widget>[
Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [],
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
TyperAnimatedTextKit(
text: const [
"silakan isi form di bawah ini !",
],
textStyle: TextStyle(
fontSize: 20,
fontWeight: bold,
color:blackColor,
),
repeatForever: true,
Text(
"Konfigurasi Self-Service !",
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(
controller: urlDolanController,
title: '( Url Host Trend )',
isShowTitle: false, validator: (value) { },
),
const SizedBox(
height: 20,
title: 'Url Host Trend',
isShowTitle: false,
validator: (value) {},
),
SizedBox(height: 20),
CustomFormField(
controller: urlCloseLoopController,
title: '( Url Host Dolan )',
isShowTitle: false, validator: (value) { },
),
const SizedBox(
height: 20,
title: 'Url Host Dolan',
isShowTitle: false,
validator: (value) {},
),
SizedBox(height: 20),
CustomFormField(
controller: urlPrePaidController,
title: '( Url Host Prepaid )',
isShowTitle: false, validator: (value) { },
title: 'Url Host Prepaid',
isShowTitle: false,
validator: (value) {},
),
const SizedBox(
height: 20,
SizedBox(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(
controller: urlCorePaymentController,
title: '( Url Core Payment )',
title: 'Url Core Payment',
isShowTitle: false,
validator: (value) {
if (value!.isEmpty) {
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://';
}
if (!value.endsWith('.com')) {
......@@ -380,45 +397,37 @@ class _SetMerchantState extends State<SetMerchant> {
return null;
},
),
const SizedBox(
height: 20,
),
SizedBox(height: 20),
CustomFormField(
controller: merchantNameController,
title: 'Nama gerai',
isShowTitle: false, validator: (value) { },
),
const SizedBox(
height: 20,
isShowTitle: false,
validator: (value) {},
),
SizedBox(height: 20),
CustomFormField(
controller: userNameController,
title: 'Nama Pengguna',
isShowTitle: false, validator: (value) { },
),
const SizedBox(
height:20,
isShowTitle: false,
validator: (value) {},
),
SizedBox(height: 20),
CustomNumberField(
controller: maxControlller,
title: "Maksimal isi ulang topup",
controller: idleController,
title: "Waktu siaga beranda (detik)",
isShowTitle: false,
),
const SizedBox(
height: 20,
),
SizedBox(height: 20),
CustomNumberField(
controller: minController,
title: "Minimal isi ulang topup",
controller: maxTapController,
title: "Maksimal Tap Wristband Beda",
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> {
print('MAX/ISIULANG/TOPUP : ${maxControlller}');
print('MIN/ISIULANG/TOPUP : ${minController}');
print('IDLE/PERDETIK : ${idleController}');
print('MAX/TAP/TOPUP : ${maxTapController}');
});
// setOutlet();
},
......
......@@ -52,6 +52,7 @@ dependencies:
animated_text_kit: ^4.2.2
validators: ^3.0.0
http: ^0.13.5
flutter_spinkit: ^5.1.0
simple_animations: ^5.0.0+2
flutter_svg: ^2.0.4
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