Commit 9456f537 authored by Izol's avatar Izol

added auto confrim in phone validation

- try to handle after topup timer
parent 81906085
......@@ -511,7 +511,8 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
context: context,
dialogType: DialogType.success,
animType: AnimType.rightSlide,
autoHide: Duration(seconds: 5),
dismissOnTouchOutside: false,
// autoHide: Duration(seconds: int.parse(idle)),
headerAnimationLoop: true,
title: 'Isi Ulang Anda Berhasil, Saldo Anda Saat Ini $balance',
titleTextStyle: blackTextStyle.copyWith(
......@@ -523,8 +524,11 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
fontSize: 18,
fontWeight: medium,
),
).show();
// isShowingDialog = true;
infoM = await StartService.print(
info,
companyName.split("-")[0],
......@@ -1232,45 +1236,52 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
tapIdle();
num = pin;
});
// print("Completed: $pin");
// print("Completed: $subPhone");
// String outletName =
// PreferencesHelper.getString('outlet_name');
// if (subPhone == pin) {
// AwesomeDialog(
// context: context,
// dialogType: DialogType.success,
// animType: AnimType.rightSlide,
// headerAnimationLoop: true,
// title: 'Berhasil verifikasi',
// desc: "verification success",
// btnOkOnPress: () {
// if (mounted) {
// Navigator.of(context,
// rootNavigator: true)
// .pop();
// denom(outletName, info);
// }
// },
// btnOkIcon: Icons.check,
// btnOkColor: Colors.green)
// .show();
// } else {
// AwesomeDialog(
// context: context,
// dialogType: DialogType.error,
// animType: AnimType.rightSlide,
// headerAnimationLoop: true,
// title:
// 'Pastikan nomor Anda sesuai !',
// desc:
// "Make sure your number matches !",
// btnOkOnPress: () {},
// btnOkIcon: Icons.cancel,
// btnOkColor: Colors.red)
// .show();
// }
if (timer != null) timer?.cancel();
tapIdle();
print("Completed: $num");
print("Completed: $subPhone");
String outletName =
PreferencesHelper.getString('outlet_name');
if (subPhone == num) {
AwesomeDialog(
context: context,
dialogType: DialogType.success,
dismissOnTouchOutside: false,
animType: AnimType.rightSlide,
headerAnimationLoop: true,
title: 'Berhasil verifikasi',
desc: "verification success",
btnOkOnPress: () {
if (timer != null) timer?.cancel();
tapIdle();
if (mounted) {
num = "";
Navigator.of(context,
rootNavigator: true)
.pop();
denom(outletName, info);
}
},
btnOkIcon: Icons.check,
btnOkColor: Colors.green)
.show();
} else {
AwesomeDialog(
context: context,
dialogType: DialogType.error,
animType: AnimType.rightSlide,
headerAnimationLoop: true,
title: 'Pastikan nomor Anda sesuai !',
desc: "Make sure your number matches !",
btnOkOnPress: () {
if (timer != null) timer?.cancel();
tapIdle();
},
btnOkIcon: Icons.cancel,
btnOkColor: Colors.red)
.show();
}
},
),
),
......
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