Commit f7b14f68 authored by Izol's avatar Izol

Update version SS.20.WWW

parent 1697aaae
sdk.dir=/Users/macbookpro/Library/Android/sdk
flutter.sdk=/Users/macbookpro/Developer/flutter
flutter.buildMode=debug
flutter.versionName=SS.19.WWW
flutter.versionCode=12
\ No newline at end of file
flutter.versionName=SS.20.WWW
flutter.versionCode=13
\ No newline at end of file
......@@ -94,6 +94,7 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
double _downloadSpeed = 0;
bool checkCountZero = false;
bool isDenomDialogShowing = false;
bool isPaymentProcessed = false;
double _targetDuration = 3; // Durasi yang dituju (dalam detik)
double _maxDurationPage = 3; // Durasi maksimum (dalam detik)
......@@ -457,14 +458,6 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
status;
info = await StartService.topupBalanceCard(cardNumber, int.parse(amount));
// if (info == null){
// tapBalance();
// return "";
// }
// if(info.toString().contains("{"))
// infoMap = jsonDecode(info);
// lastBalance = infoMap['balance'].toString();
// samReport = infoMap['report'].toString();
if (info == null) {
tapBalance();
return "";
......@@ -478,12 +471,10 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
tapBalance();
return "";
}
paymentMethod = 'Qris';
var infoPaymentNotes = jsonDecode(info);
var reffNo = trxId.toString();
paymentProvider = '';
paymentProvider = "";
paymentNotes = "reffNo: $reffNo\nprovider: $paymentNotes";
print("ini adalag test hasil payment notes:$paymentNotes");
tid = PreferencesHelper.getString('outletname');
......@@ -1061,6 +1052,7 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
void tapBalance() async {
Future.delayed(const Duration(milliseconds: 500), () async {
// await StartService.initLibrary();
var isTap = await StartService.getCard();
try {
var infoMap = jsonDecode(isTap);
......@@ -1068,6 +1060,7 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
} catch (e) {
if (isTap == "Card Not Found") {
print("Card Not Found");
await StartService.initLibrary();
AwesomeDialog(
context: context,
dialogType: DialogType.info,
......@@ -1092,6 +1085,7 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
).show();
} else if (isTap == "Error Get Card Type"){
print("Error Get Card Type");
await StartService.initLibrary();
AwesomeDialog(
context: context,
dialogType: DialogType.info,
......@@ -1116,6 +1110,32 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
).show();
} else if (isTap == "CardInfoError: 5001"){
print("CardInfoError: 5001");
await StartService.initLibrary();
AwesomeDialog(
context: context,
dialogType: DialogType.info,
animType: AnimType.rightSlide,
dismissOnTouchOutside: false,
headerAnimationLoop: true,
title: 'Coba Lagi!',
titleTextStyle: blackTextStyle.copyWith(
fontSize: 20,
fontWeight: bold,
),
desc: "Try Again!",
descTextStyle: greyTextStyle.copyWith(
fontSize: 18,
fontWeight: light,
),
btnOkOnPress: () {
countMax = 0;
tapBalance();
},
btnOkColor: Colors.blue,
).show();
} else if (isTap == "Get TicketList Error 5001"){
print("Get TicketList Error 5001");
await StartService.initLibrary();
AwesomeDialog(
context: context,
dialogType: DialogType.info,
......@@ -1142,6 +1162,7 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
print("Error $isTap");
}
}
});
}
......@@ -2139,6 +2160,7 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
// Button Saya sudah Bayar di Showqris
TextButton(
onPressed: () async {
if (isProcessCheck) return; // Tambahkan pengecekan jika proses sedang berjalan
setState(() => isProcessCheck = true);
try {
bool result = await _cekStatus();
......@@ -2148,20 +2170,20 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
Navigator.pop(context);
showPop(approvalCode);
} else {
setState(() => isProcessCheck = false);
// isProcessCheck = false; // Hapus baris ini
setState(() => isProcessCheck = false); // Pindahkan baris ini ke bawah AwesomeDialog
AwesomeDialog(
context: context,
dialogType: DialogType.error,
animType: AnimType.rightSlide,
headerAnimationLoop: true,
title: 'Belum Terbayar !',
desc: "Not paid yet !",
btnOkOnPress: () {},
btnOkIcon: Icons.cancel,
btnOkColor: Colors.red)
.show();
context: context,
dialogType: DialogType.error,
animType: AnimType.rightSlide,
headerAnimationLoop: true,
title: 'Belum Terbayar !',
desc: "Not paid yet !",
btnOkOnPress: () {},
btnOkIcon: Icons.cancel,
btnOkColor: Colors.red,
).show();
}
// isProcessCheck = false;
});
} catch (e) {
print("Error: $e");
......
......@@ -71,20 +71,6 @@ class _TapCardAktivasiState extends State<TapCardAktivasi>
});
}
// void aktivasi() async {
// Future.delayed(Duration(seconds: 5), () async {
// // var isTap = await StartService.initLibrary();
// var isLoad = await StartService.activateLibrary();
// print(isLoad);
// if (isLoad == true) {
// _showDialSuccess();
// } else {
// _showDialFail();
// }
// });
// }
Future<void> _showDialFail() async {
return showDialog<void>(
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