Commit da73a8b7 authored by Izol's avatar Izol

adjust_validation_to_print_transactions_positive_negative

parent 9ab4a3c6
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
<change beforePath="$PROJECT_DIR$/android/.gradle/7.4/fileHashes/fileHashes.bin" beforeDir="false" afterPath="$PROJECT_DIR$/android/.gradle/7.4/fileHashes/fileHashes.bin" afterDir="false" /> <change beforePath="$PROJECT_DIR$/android/.gradle/7.4/fileHashes/fileHashes.bin" beforeDir="false" afterPath="$PROJECT_DIR$/android/.gradle/7.4/fileHashes/fileHashes.bin" afterDir="false" />
<change beforePath="$PROJECT_DIR$/android/.gradle/7.4/fileHashes/fileHashes.lock" beforeDir="false" afterPath="$PROJECT_DIR$/android/.gradle/7.4/fileHashes/fileHashes.lock" afterDir="false" /> <change beforePath="$PROJECT_DIR$/android/.gradle/7.4/fileHashes/fileHashes.lock" beforeDir="false" afterPath="$PROJECT_DIR$/android/.gradle/7.4/fileHashes/fileHashes.lock" afterDir="false" />
<change beforePath="$PROJECT_DIR$/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock" beforeDir="false" afterPath="$PROJECT_DIR$/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock" afterDir="false" /> <change beforePath="$PROJECT_DIR$/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock" beforeDir="false" afterPath="$PROJECT_DIR$/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock" afterDir="false" />
<change beforePath="$PROJECT_DIR$/android/.gradle/buildOutputCleanup/outputFiles.bin" beforeDir="false" afterPath="$PROJECT_DIR$/android/.gradle/buildOutputCleanup/outputFiles.bin" afterDir="false" />
<change beforePath="$PROJECT_DIR$/android/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/android/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/android/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/android/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/daemon/7.4/registry.bin" beforeDir="false" afterPath="$PROJECT_DIR$/daemon/7.4/registry.bin" afterDir="false" /> <change beforePath="$PROJECT_DIR$/daemon/7.4/registry.bin" beforeDir="false" afterPath="$PROJECT_DIR$/daemon/7.4/registry.bin" afterDir="false" />
<change beforePath="$PROJECT_DIR$/daemon/7.4/registry.bin.lock" beforeDir="false" afterPath="$PROJECT_DIR$/daemon/7.4/registry.bin.lock" afterDir="false" /> <change beforePath="$PROJECT_DIR$/daemon/7.4/registry.bin.lock" beforeDir="false" afterPath="$PROJECT_DIR$/daemon/7.4/registry.bin.lock" afterDir="false" />
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
<change beforePath="$PROJECT_DIR$/.gradle/7.4/fileHashes/fileHashes.bin" beforeDir="false" afterPath="$PROJECT_DIR$/.gradle/7.4/fileHashes/fileHashes.bin" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.gradle/7.4/fileHashes/fileHashes.bin" beforeDir="false" afterPath="$PROJECT_DIR$/.gradle/7.4/fileHashes/fileHashes.bin" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.gradle/7.4/fileHashes/fileHashes.lock" beforeDir="false" afterPath="$PROJECT_DIR$/.gradle/7.4/fileHashes/fileHashes.lock" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.gradle/7.4/fileHashes/fileHashes.lock" beforeDir="false" afterPath="$PROJECT_DIR$/.gradle/7.4/fileHashes/fileHashes.lock" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.gradle/buildOutputCleanup/buildOutputCleanup.lock" beforeDir="false" afterPath="$PROJECT_DIR$/.gradle/buildOutputCleanup/buildOutputCleanup.lock" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.gradle/buildOutputCleanup/buildOutputCleanup.lock" beforeDir="false" afterPath="$PROJECT_DIR$/.gradle/buildOutputCleanup/buildOutputCleanup.lock" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.gradle/buildOutputCleanup/outputFiles.bin" beforeDir="false" afterPath="$PROJECT_DIR$/.gradle/buildOutputCleanup/outputFiles.bin" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../daemon/7.4/registry.bin" beforeDir="false" afterPath="$PROJECT_DIR$/../daemon/7.4/registry.bin" afterDir="false" /> <change beforePath="$PROJECT_DIR$/../daemon/7.4/registry.bin" beforeDir="false" afterPath="$PROJECT_DIR$/../daemon/7.4/registry.bin" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../daemon/7.4/registry.bin.lock" beforeDir="false" afterPath="$PROJECT_DIR$/../daemon/7.4/registry.bin.lock" afterDir="false" /> <change beforePath="$PROJECT_DIR$/../daemon/7.4/registry.bin.lock" beforeDir="false" afterPath="$PROJECT_DIR$/../daemon/7.4/registry.bin.lock" afterDir="false" />
......
No preview for this file type
...@@ -344,37 +344,6 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback { ...@@ -344,37 +344,6 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
print('topup gagal'); print('topup gagal');
isShowingDialog = true; isShowingDialog = true;
// String companyName, companyPhone, denom;
// companyName = PreferencesHelper.getString('outletname');
// companyPhone = PreferencesHelper.getString('companyphone');
// denom = amountController!.text.replaceAll(",", "");
// infoM = await StartService.print(
// info,
// companyName.split("-")[0],
// companyAddress,
// companyPhone,
// approvalCode,
// prevBalance!,
// "1",
// (int.parse("10")+int.parse("1")+int.parse("0")).toString(),
// denom.replaceAll(",", ""));
// AwesomeDialog(
// context: context,
// dialogType: DialogType.error,
// animType: AnimType.rightSlide,
// headerAnimationLoop: true,
// title: 'Saldo Anda Tidak Bertambah $balance',
// titleTextStyle: blackTextStyle.copyWith(
// fontSize: 20,
// fontWeight: bold,
// ),
// desc: "Periksa Kembali Struk Anda !",
// descTextStyle: blackTextStyle.copyWith(
// fontSize: 18,
// fontWeight: medium,
// ),
// )
// .show();
} }
return ""; return "";
} }
...@@ -438,7 +407,7 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback { ...@@ -438,7 +407,7 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
if (info.toString().toLowerCase().contains('failed')) { if (info.toString().toLowerCase().contains('failed')) {
print('ini pesan salah'); print('ini pesan salah');
message = "Silakan Tempel Wristband Anda Di Reader"; message = "Silakan Tempel Wristband Anda Di Reader";
tapDial(); tapBalance();
} else { } else {
infoCard = info; infoCard = info;
var infoMap = jsonDecode(info); var infoMap = jsonDecode(info);
...@@ -457,6 +426,7 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback { ...@@ -457,6 +426,7 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
title: 'Kartu tidak sama ! tempelkan kartu sebelumnya', title: 'Kartu tidak sama ! tempelkan kartu sebelumnya',
desc: "Cards are not the same! please put the previous card ${countMax}", desc: "Cards are not the same! please put the previous card ${countMax}",
btnOkOnPress: () async { btnOkOnPress: () async {
if (timer != null) timer?.cancel();
if (countMax < 3) { if (countMax < 3) {
var isTap = await StartService.getCard(); var isTap = await StartService.getCard();
_getInfoBeforeTopup(isTap); _getInfoBeforeTopup(isTap);
...@@ -469,11 +439,31 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback { ...@@ -469,11 +439,31 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
headerAnimationLoop: true, headerAnimationLoop: true,
title: 'Transaksi anda gagal ! dikarenakan tidak menempelkan kartu sebelumnya', title: 'Transaksi anda gagal ! dikarenakan tidak menempelkan kartu sebelumnya',
desc: "Your transaction failed ! because didn't attach the previous card!", desc: "Your transaction failed ! because didn't attach the previous card!",
btnOkOnPress: () { btnOkOnPress: (){
Navigator.pop(context);
setState(() { setState(() {
countMax = 0; countMax = 0 ;
}); }); /*disini juga ga bisa*/
if (timer != null) timer?.cancel();
// Navigator.pop(context);
String companyName, companyPhone, denom;
companyName = 'Rockefeller';
companyPhone = 'TOPUP - GAGAL';
companyAddress = 'st.indonesia, jakarta raya';
denom = amountController!.text.replaceAll(",", "");
String sca =
PreferencesHelper.getString("multioutletservicechargeamount");
String sc = PreferencesHelper.getString("multioutletservicecharge");
StartService.print(
info,
companyName.split("-")[0],
companyAddress,
companyPhone,
approvalCode,
prevBalance!,
"1",
(int.parse("10") + int.parse("1") + int.parse("0")).toString(),
denom.replaceAll(",", ""));
Navigator.pop(context);
}, },
btnOkIcon: Icons.cancel, btnOkIcon: Icons.cancel,
btnOkColor: Colors.red) btnOkColor: Colors.red)
...@@ -483,16 +473,24 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback { ...@@ -483,16 +473,24 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
btnOkIcon: Icons.cancel, btnOkIcon: Icons.cancel,
btnOkColor: Colors.red) btnOkColor: Colors.red)
.show(); .show();
// setState((){ // setState(() {
// dataQris = null; // countMax = 0 ;
// isShowingDialog = false; // }); kalo ditaro disini bisa manggil kalo berhasil
// }); Future.delayed(Duration(seconds: int.parse(idle)), () {
// if (timer != null) timer?.cancel(); if (timer != null) timer?.cancel();
// tapIdle(); isShowingDialog = false;
tapIdle();
// if(mounted){
// setState(() {
// countMax= 0;
// });
// }
});
} }
// ini udah tpi dia muncul notif
} }
// setState(() {
// countMax= 0;
// });
}); });
} }
...@@ -558,10 +556,9 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback { ...@@ -558,10 +556,9 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
).show(); ).show();
Future.delayed(Duration(seconds: int.parse(idle)), () { Future.delayed(Duration(seconds: int.parse(idle)), () {
Navigator.pop(context); Navigator.pop(context);
timer?.cancel(); if (timer != null) timer?.cancel();
isShowingDialog = true; isShowingDialog = false;
_showTap(); tapIdle();
tapDial();
}); });
// timer = Timer.periodic(Duration(seconds: int.parse(idle)),(timer){ // timer = Timer.periodic(Duration(seconds: int.parse(idle)),(timer){
// print("ini pesan waktu idle : $idle"); // print("ini pesan waktu idle : $idle");
...@@ -603,7 +600,6 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback { ...@@ -603,7 +600,6 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
cardType = "Tidak Terdaftar"; cardType = "Tidak Terdaftar";
break; break;
} }
balance = CurrencyFormat.convertToIdr( balance = CurrencyFormat.convertToIdr(
infoMap["balance"], infoMap["balance"],
2, 2,
...@@ -667,6 +663,14 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback { ...@@ -667,6 +663,14 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
}); });
} }
void tapBalance() async {
Future.delayed(const Duration(milliseconds: 200), () async {
var isTap = await StartService.getCard();
_getInfoBalance(isTap);
// timer?.cancel();
});
}
Future<void> _showTap() { Future<void> _showTap() {
return showDialog<void>( return showDialog<void>(
context: context, context: context,
......
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