Commit b9d71bf4 authored by Izol's avatar Izol

update version 1.1.9

parent 2cb61044
sdk.dir=/Users/macbookpro/Library/Android/sdk
flutter.sdk=/Users/macbookpro/Developer/flutter
flutter.buildMode=debug
flutter.versionName=SS.8.WWW
flutter.versionCode=1
\ No newline at end of file
flutter.versionName=SS.9.WWW
flutter.versionCode=1.1.9
\ No newline at end of file
......@@ -559,20 +559,23 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
return result;
}
_getInfoBeforeTopup(var info) {
setState(() {
if (info.toString().toLowerCase().contains('failed')) {
print('ini pesan salah');
message = "Silakan Tempel Wristband Anda Di Reader";
tapBalance();
} else {
}
else {
countMax += 1;
infoCard = info;
var infoMap = jsonDecode(info);
String newCardNumber = infoMap["cardNumber"];
if (newCardNumber == cardNumber) {
topUpBalance(approvalCode);
} else {
}
else {
AwesomeDialog(
context: context,
dismissOnTouchOutside: false,
......@@ -585,8 +588,6 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
btnOkOnPress: () async {
if (timer != null) timer?.cancel();
if (countMax < 3) {
// var isTap = await StartService.getCard();
// _getInfoBeforeTopup(isTap);
tapBalance();
} else {
AwesomeDialog(
......@@ -600,13 +601,6 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
desc:
"Your transaction failed ! because didn't attach the previous card!",
btnOkOnPress: () {
// countMax = 0;
// setState(() {
// isShowingDialog = false;
// });
// if (timer != null) timer?.cancel();
// tapIdle();
String companyName, companyPhone, metodeBayar;
companyName =
PreferencesHelper.getString('outletname');
......@@ -635,7 +629,7 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
int.parse(sc))
.toString(),
'0',
metodeBayar,
PreferencesHelper.getString("provider"),
'Gagal',
);
AwesomeDialog(
......@@ -837,8 +831,8 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
// set timer dengan durasi 1 detik
duration -= 1;
idleDuration.value = duration; // set nilai baru untuk idleDuration
print("ini pesan waktu idle : $idleDuration");
print("isShowingdialog : $isShowingDialog");
// print("ini pesan waktu idle : $idleDuration");
// print("isShowingdialog : $isShowingDialog");
if (duration == 0 && !isShowingDialog) {
// jika idleDuration sudah habis dan dialog tidak sedang ditampilkan
isShowingDialog = true;
......@@ -876,6 +870,19 @@ 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();
......@@ -884,11 +891,23 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
_getInfoBeforeTopup(isTap);
} catch (e) {
print("Error $isTap");
AwesomeDialog(
context: context,
dialogType: DialogType.info,
animType: AnimType.rightSlide,
headerAnimationLoop: true,
title: 'Pastikan Wristband Anda Tertempel Di Reader !',
desc: "Make sure your wristband is attached to the reader !",
btnOkOnPress: () {
tapBalance();
},
btnOkColor: Colors.blue)
.show();
}
});
}
Future<void> _showTap() {
return showDialog<void>(
context: context,
......@@ -1344,7 +1363,7 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
child: ListBody(
children: <Widget>[
Container(
margin: EdgeInsets.only(top: 30),
margin: EdgeInsets.only(top: 0),
padding: EdgeInsets.symmetric(horizontal: 17),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
......@@ -1418,16 +1437,7 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Center(
child: Text(
'topup balance',
style: greyTextStyle.copyWith(
fontSize: 15,
fontStyle: FontStyle.italic,
fontWeight: light,
),
),
),
SizedBox(height: 15,),
Text(
'Pilih nominal isi ulang',
style: blackTextStyle.copyWith(
......
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