Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
Dolan SelfService Topup
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Faizol
Dolan SelfService Topup
Commits
07b8f4fd
Commit
07b8f4fd
authored
Aug 10, 2023
by
Gandha Ryanto
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/simplyfy-v2' into simplyfy-v2
parents
0716d907
01335cd2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
296 additions
and
279 deletions
+296
-279
MainActivity.kt
...rc/main/kotlin/com/example/self_service_3/MainActivity.kt
+2
-47
home_page.dart
lib/ui/pages/home_page.dart
+294
-232
No files found.
android/app/src/main/kotlin/com/example/self_service_3/MainActivity.kt
View file @
07b8f4fd
...
@@ -301,51 +301,6 @@ class MainActivity : MethodChannel.MethodCallHandler, FlutterActivity(), MifareT
...
@@ -301,51 +301,6 @@ class MainActivity : MethodChannel.MethodCallHandler, FlutterActivity(), MifareT
)
)
print
(
"model ${Build.MODEL}"
)
print
(
"model ${Build.MODEL}"
)
// if (Build.MODEL == "T2s" || Build.MODEL == "T2Mini" || Build.MODEL == "T2mini") {
// if (Build.MODEL == "T2s" || Build.MODEL == "T2Mini" || Build.MODEL == "T2mini") {
if
(
Build
.
MODEL
==
"T2s"
||
Build
.
MODEL
==
"T2Mini"
)
{
var
text
=
"""
[C]${companyName}
[C]${companyAddress}
[C]${companyPhone}
[C]--------------------------------
[L]xTanggal : ${sdf.format(timeNow)}
[L]xNo Transaksi : ${approvalCode}
[L] No Kartu : ${ticket.cardNumber.toString()}
[L]Masa Berlaku : ${sdf.format(cardExpiry)}"""
if
(
status
==
"Berhasil"
){
text
+=
"""
[L]Saldo Awal : Rp${formatDecimalToPrice(prevBalance.toDouble()).toString()}
[L]Isi Saldo : Rp${formatDecimalToPrice(denom.toDouble()).toString()}
[L]Saldo Akhir : Rp${formatDecimalToPrice(ticket.balance!!.toDouble()).toString()}
[L]Biaya Layanan : Rp${formatDecimalToPrice(serviceCharge.toDouble()).toString()}
[L]Jumlah Bayar : Rp${formatDecimalToPrice(serviceChargeAmount.toDouble()).toString()}
[L]Metode Bayar : ${metodeBayar}
[L]Status : ${status}
[C]--------------------------------
[C]Top Up Berhasil
[C]powered by dolanapp.com
"""
}
else
{
text
+=
"""
[L]Saldo : Rp${formatDecimalToPrice(prevBalance.toDouble()).toString()}
[L]Biaya Layanan : Rp${formatDecimalToPrice(serviceCharge.toDouble()).toString()}
[L]Jumlah Bayar : Rp${formatDecimalToPrice(serviceChargeAmount.toDouble()).toString()}
[L]Metode Bayar : ${metodeBayar}
[L]Status : ${status}
[C]--------------------------------
[C]Top Up Gagal
[C]powered by dolanapp.com
"""
}
text
=
text
.
trimIndent
()
_mifareTicketing
?.
generateReceiptTopup
(
null
,
text
,
bitmapIcon
,
paperWidth
=
57F
,
isBluetooth
=
true
)
}
else
{
var
receiptLayout
=
ReceiptBuilder
(
570
)
var
receiptLayout
=
ReceiptBuilder
(
570
)
.
setMarginTop
(
30
)
.
setMarginTop
(
30
)
.
setMarginLeft
(
30
)
.
setMarginLeft
(
30
)
...
@@ -389,7 +344,7 @@ class MainActivity : MethodChannel.MethodCallHandler, FlutterActivity(), MifareT
...
@@ -389,7 +344,7 @@ class MainActivity : MethodChannel.MethodCallHandler, FlutterActivity(), MifareT
.
addBlankSpace
(
10
)
.
addBlankSpace
(
10
)
.
addText
(
"Masa Berlaku...............: "
+
sdf
.
format
(
cardExpiry
))
.
addText
(
"Masa Berlaku...............: "
+
sdf
.
format
(
cardExpiry
))
.
addBlankSpace
(
10
)
.
addBlankSpace
(
10
)
if
(
status
==
"Berhasil"
){
if
(
status
==
"
Isi Saldo
Berhasil"
){
receiptLayout
.
addText
(
"Saldo Awal...................: Rp"
+
formatDecimalToPrice
(
prevBalance
.
toDouble
()).
toString
())
receiptLayout
.
addText
(
"Saldo Awal...................: Rp"
+
formatDecimalToPrice
(
prevBalance
.
toDouble
()).
toString
())
.
addBlankSpace
(
10
)
.
addBlankSpace
(
10
)
.
addText
(
"Isi Saldo.........................: Rp"
+
formatDecimalToPrice
(
denom
.
toDouble
()))
.
addText
(
"Isi Saldo.........................: Rp"
+
formatDecimalToPrice
(
denom
.
toDouble
()))
...
@@ -438,7 +393,7 @@ class MainActivity : MethodChannel.MethodCallHandler, FlutterActivity(), MifareT
...
@@ -438,7 +393,7 @@ class MainActivity : MethodChannel.MethodCallHandler, FlutterActivity(), MifareT
}
}
val
finalReceiptLayout
:
ReceiptBuilder
=
receiptLayout
val
finalReceiptLayout
:
ReceiptBuilder
=
receiptLayout
_mifareTicketing
?.
generateReceiptTopup
(
finalReceiptLayout
,
""
,
null
,
paperWidth
=
570F
,
isBluetooth
=
false
)
_mifareTicketing
?.
generateReceiptTopup
(
finalReceiptLayout
,
""
,
null
,
paperWidth
=
570F
,
isBluetooth
=
false
)
}
}
}
}
}
lib/ui/pages/home_page.dart
View file @
07b8f4fd
...
@@ -494,6 +494,17 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
...
@@ -494,6 +494,17 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
print
(
"lastBalance
$lastBalance
"
);
print
(
"lastBalance
$lastBalance
"
);
print
(
"prevBalance
$prevBalance
"
);
print
(
"prevBalance
$prevBalance
"
);
String
ticketJson
,
companyName
,
companyPhone
,
denom
;
companyName
=
PreferencesHelper
.
getString
(
'outletname'
);
companyPhone
=
PreferencesHelper
.
getString
(
'companyphone'
);
companyAddress
=
PreferencesHelper
.
getString
(
'multioutletaddress'
);
denom
=
amountController
!.
text
.
replaceAll
(
","
,
""
);
String
sca
=
PreferencesHelper
.
getString
(
"multioutletservicechargeamount"
);
String
sc
=
PreferencesHelper
.
getString
(
"multioutletservicecharge"
);
// String metodeBayar = PreferencesHelper.getString("provider");
// String status = "Berhasil";
if
(
int
.
parse
(
lastBalance
)
>
int
.
parse
(
prevBalance
!))
{
if
(
int
.
parse
(
lastBalance
)
>
int
.
parse
(
prevBalance
!))
{
countMax
=
0
;
countMax
=
0
;
var
result
=
await
StartService
.
topUpConfirm
(
var
result
=
await
StartService
.
topUpConfirm
(
...
@@ -562,16 +573,6 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
...
@@ -562,16 +573,6 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
DatabaseHelper
.
insertTransaction
(
wristbandInfo
);
DatabaseHelper
.
insertTransaction
(
wristbandInfo
);
print
(
"ini pesan tersimpan berhasil ke database
$wristbandInfo
"
);
print
(
"ini pesan tersimpan berhasil ke database
$wristbandInfo
"
);
String
ticketJson
,
companyName
,
companyPhone
,
denom
;
companyName
=
PreferencesHelper
.
getString
(
'outletname'
);
companyPhone
=
PreferencesHelper
.
getString
(
'companyphone'
);
companyAddress
=
PreferencesHelper
.
getString
(
'multioutletaddress'
);
denom
=
amountController
!.
text
.
replaceAll
(
","
,
""
);
String
sca
=
PreferencesHelper
.
getString
(
"multioutletservicechargeamount"
);
String
sc
=
PreferencesHelper
.
getString
(
"multioutletservicecharge"
);
String
metodeBayar
=
PreferencesHelper
.
getString
(
"provider"
);
String
status
=
"Berhasil"
;
_getInfoBalance
(
info
);
_getInfoBalance
(
info
);
...
@@ -616,14 +617,48 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
...
@@ -616,14 +617,48 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
sca
!
+
sc
!,
sca
!
+
sc
!,
(
int
.
parse
(
amount
)
+
int
.
parse
(
sca
)
+
int
.
parse
(
sc
)).
toString
(),
(
int
.
parse
(
amount
)
+
int
.
parse
(
sca
)
+
int
.
parse
(
sc
)).
toString
(),
denom
.
replaceAll
(
","
,
""
),
denom
.
replaceAll
(
","
,
""
),
metodeBayar
,
PreferencesHelper
.
getString
(
"provider"
)
,
status
,
"Isi Saldo Berhasil"
,
);
);
isHitApi
=
false
;
isHitApi
=
false
;
}
else
{
}
else
{
print
(
'topup gagal'
);
print
(
'topup gagal'
);
AwesomeDialog
(
context:
context
,
autoHide:
Duration
(
seconds:
10
),
dialogType:
DialogType
.
error
,
animType:
AnimType
.
rightSlide
,
headerAnimationLoop:
true
,
title:
"Transaksi isi ulang anda tidak berhasil
\n
simpan bukti pembayaran untuk di tunjukkan kepada petugas"
,
titleTextStyle:
blackTextStyle
.
copyWith
(
fontSize:
20
,
fontWeight:
bold
,
),
desc:
"Your top up transaction was not successful
\n
Save proof of payment to show to the officer"
,
descTextStyle:
greyTextStyle
.
copyWith
(
fontSize:
18
,
fontWeight:
light
,
),
).
show
().
then
((
value
)
{
});
isShowingDialog
=
true
;
isShowingDialog
=
true
;
dataQris
==
null
;
dataQris
==
null
;
StartService
.
print
(
prevInfoCard
,
companyName
.
split
(
"-"
)[
0
],
companyAddress
,
companyPhone
,
approvalCode
,
lastBalance
!,
sca
!
+
sc
!,
(
int
.
parse
(
amount
)
+
int
.
parse
(
sca
)
+
int
.
parse
(
sc
))
.
toString
(),
denom
.
replaceAll
(
","
,
""
),
PreferencesHelper
.
getString
(
"provider"
),
"isi saldo tidak berhasil"
,
);
}
}
return
""
;
return
""
;
}
}
...
@@ -700,87 +735,81 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
...
@@ -700,87 +735,81 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
tapBalance
();
tapBalance
();
}
else
{
}
else
{
AwesomeDialog
(
AwesomeDialog
(
context:
context
,
context:
context
,
dismissOnTouchOutside:
false
,
dismissOnTouchOutside:
false
,
dialogType:
DialogType
.
error
,
autoHide:
Duration
(
seconds:
5
),
animType:
AnimType
.
rightSlide
,
dialogType:
DialogType
.
error
,
headerAnimationLoop:
true
,
animType:
AnimType
.
rightSlide
,
title:
headerAnimationLoop:
true
,
'Transaksi anda gagal ! dikarenakan tidak menempelkan wristband sebelumnya'
,
title:
desc:
'Transaksi anda gagal ! dikarenakan tidak menempelkan wristband sebelumnya'
,
"Your transaction failed ! because didn't attach the previous card!"
,
desc:
btnOkOnPress:
()
{
"Your transaction failed ! because didn't attach the previous card!"
,
String
companyName
,
companyPhone
,
metodeBayar
;
).
show
().
then
((
value
)
{
companyName
=
String
companyName
,
companyPhone
,
metodeBayar
;
PreferencesHelper
.
getString
(
'outletname'
);
companyName
=
PreferencesHelper
.
getString
(
'outletname'
);
companyName
=
companyName
=
PreferencesHelper
.
getString
(
'outletname'
);
PreferencesHelper
.
getString
(
'outletname'
);
companyPhone
=
companyPhone
=
PreferencesHelper
.
getString
(
'companyphone'
);
PreferencesHelper
.
getString
(
'companyphone'
);
companyAddress
=
companyAddress
=
PreferencesHelper
.
getString
(
PreferencesHelper
.
getString
(
'multioutletaddress'
);
'multioutletaddress'
);
lastBalance
=
infoMap
[
'balance'
].
toString
();
lastBalance
=
infoMap
[
'balance'
].
toString
();
metodeBayar
=
"link-aja"
;
metodeBayar
=
"link-aja"
;
String
sca
=
PreferencesHelper
.
getString
(
String
sca
=
PreferencesHelper
.
getString
(
"multioutletservicechargeamount"
);
"multioutletservicechargeamount"
);
String
sc
=
PreferencesHelper
.
getString
(
String
sc
=
PreferencesHelper
.
getString
(
"multioutletservicecharge"
);
"multioutletservicecharge"
);
_getInfoBalance
(
info
);
_getInfoBalance
(
info
);
AwesomeDialog
(
AwesomeDialog
(
context:
context
,
context:
context
,
dismissOnTouchOutside:
false
,
dismissOnTouchOutside:
false
,
autoHide:
Duration
(
seconds:
10
),
autoHide:
Duration
(
seconds:
10
),
dialogType:
DialogType
.
error
,
dialogType:
DialogType
.
error
,
animType:
AnimType
.
rightSlide
,
animType:
AnimType
.
rightSlide
,
headerAnimationLoop:
true
,
headerAnimationLoop:
true
,
title:
title:
'Transaksi isi ulang anda tidak berhasil
\n
simpan bukti pembayaran untuk di tunjukkan kepada petugas'
,
'Transaksi isi ulang anda tidak berhasil
\n
simpan bukti pembayaran untuk di tunjukkan kepada petugas'
,
titleTextStyle:
blackTextStyle
.
copyWith
(
titleTextStyle:
blackTextStyle
.
copyWith
(
fontSize:
20
,
fontSize:
20
,
fontWeight:
bold
,
fontWeight:
bold
,
),
),
desc:
desc:
"Your top up transaction was not successful
\n
Save proof of payment to show to the officer"
,
"Your top up transaction was not successful
\n
Save proof of payment to show to the officer"
,
descTextStyle:
greyTextStyle
.
copyWith
(
descTextStyle:
greyTextStyle
.
copyWith
(
fontSize:
18
,
fontSize:
18
,
fontWeight:
light
,
fontWeight:
light
,
),
),
).
show
().
then
((
value
)
{
).
show
().
then
((
value
)
{
Navigator
.
of
(
context
).
pop
();
Navigator
.
of
(
context
).
pop
();
countMax
=
0
;
countMax
=
0
;
setState
(()
=>
isProcessCheck
=
false
);
setState
(()
=>
isProcessCheck
=
false
);
checkCountZero
=
false
;
checkCountZero
=
false
;
timer
?.
cancel
();
timer
?.
cancel
();
isShowingDialog
=
true
;
isShowingDialog
=
true
;
trxId
=
""
;
trxId
=
""
;
reffNo
=
""
;
reffNo
=
""
;
_showTap
();
_showTap
();
tapDial
();
tapDial
();
});
});
StartService
.
print
(
StartService
.
print
(
prevInfoCard
,
prevInfoCard
,
companyName
.
split
(
"-"
)[
0
],
companyName
.
split
(
"-"
)[
0
],
companyAddress
,
companyAddress
,
companyPhone
,
companyPhone
,
approvalCode
,
approvalCode
,
lastBalance
!,
lastBalance
!,
sca
!
+
sc
!,
sca
!
+
sc
!,
(
int
.
parse
(
amount
)
+
int
.
parse
(
sca
)
+
int
.
parse
(
sc
))
(
int
.
parse
(
amount
)
+
.
toString
(),
int
.
parse
(
sca
)
+
'0'
,
int
.
parse
(
sc
))
PreferencesHelper
.
getString
(
"provider"
),
.
toString
(),
'Gagal Wristband Berbeda'
,
'0'
,
);
PreferencesHelper
.
getString
(
"provider"
),
// Navigator.pop(context);
'Gagal'
,
});
);
// Navigator.pop(context);
},
btnOkIcon:
Icons
.
cancel
,
btnOkColor:
Colors
.
red
)
.
show
();
}
}
},
},
btnOkIcon:
Icons
.
cancel
,
btnOkIcon:
Icons
.
cancel
,
...
@@ -1156,7 +1185,8 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
...
@@ -1156,7 +1185,8 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
},
},
btnOkColor:
Colors
.
blue
,
btnOkColor:
Colors
.
blue
,
).
show
();
).
show
();
}
else
if
(
isTap
==
"Error Get Card Type"
)
{
}
else
if
(
isTap
==
"Error Get Card Type"
)
{
print
(
"Error Get Card Type"
);
print
(
"Error Get Card Type"
);
await
StartService
.
initLibrary
();
await
StartService
.
initLibrary
();
AwesomeDialog
(
AwesomeDialog
(
...
@@ -1181,7 +1211,8 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
...
@@ -1181,7 +1211,8 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
},
},
btnOkColor:
Colors
.
blue
,
btnOkColor:
Colors
.
blue
,
).
show
();
).
show
();
}
else
if
(
isTap
==
"CardInfoError: 5001"
)
{
}
else
if
(
isTap
==
"CardInfoError: 5001"
)
{
print
(
"CardInfoError: 5001"
);
print
(
"CardInfoError: 5001"
);
await
StartService
.
initLibrary
();
await
StartService
.
initLibrary
();
AwesomeDialog
(
AwesomeDialog
(
...
@@ -1206,7 +1237,8 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
...
@@ -1206,7 +1237,8 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
},
},
btnOkColor:
Colors
.
blue
,
btnOkColor:
Colors
.
blue
,
).
show
();
).
show
();
}
else
if
(
isTap
==
"Get TicketList Error 5001"
)
{
}
else
if
(
isTap
==
"Get TicketList Error 5001"
)
{
print
(
"Get TicketList Error 5001"
);
print
(
"Get TicketList Error 5001"
);
await
StartService
.
initLibrary
();
await
StartService
.
initLibrary
();
AwesomeDialog
(
AwesomeDialog
(
...
@@ -1231,8 +1263,33 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
...
@@ -1231,8 +1263,33 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
},
},
btnOkColor:
Colors
.
blue
,
btnOkColor:
Colors
.
blue
,
).
show
();
).
show
();
}
else
{
}
print
(
"Error
$isTap
"
);
else
{
print
(
"Error Saat Topup Balance
$isTap
"
);
await
StartService
.
initLibrary
();
AwesomeDialog
(
context:
context
,
dialogType:
DialogType
.
info
,
animType:
AnimType
.
rightSlide
,
dismissOnTouchOutside:
false
,
headerAnimationLoop:
true
,
title:
"Terjadi Kesalahan Saat Isi Saldo"
,
titleTextStyle:
blackTextStyle
.
copyWith
(
fontSize:
20
,
fontWeight:
bold
,
),
desc:
"An Error Occurred When Topup Balance"
,
descTextStyle:
greyTextStyle
.
copyWith
(
fontSize:
18
,
fontWeight:
light
,
),
btnOkText:
"Coba lagi"
,
btnOkColor:
Colors
.
blue
,
btnOkOnPress:
(){
countMax
=
0
;
tapBalance
();
}
).
show
();
}
}
}
}
});
});
...
@@ -1720,7 +1777,6 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
...
@@ -1720,7 +1777,6 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
if
(
timer
!=
null
)
if
(
timer
!=
null
)
timer
?.
cancel
();
timer
?.
cancel
();
tapIdle
();
tapIdle
();
if
(
mounted
)
{
if
(
mounted
)
{
setState
(()
{
setState
(()
{
amountController
!.
text
=
amountController
!.
text
=
...
@@ -1760,7 +1816,6 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
...
@@ -1760,7 +1816,6 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
if
(
timer
!=
null
)
if
(
timer
!=
null
)
timer
?.
cancel
();
timer
?.
cancel
();
tapIdle
();
tapIdle
();
if
(
mounted
)
{
if
(
mounted
)
{
setState
(()
{
setState
(()
{
amountController
!.
text
=
amountController
!.
text
=
...
@@ -2180,146 +2235,150 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
...
@@ -2180,146 +2235,150 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
child:
FutureBuilder
(
child:
FutureBuilder
(
future:
Future
.
delayed
(
Duration
(
seconds:
5
)),
future:
Future
.
delayed
(
Duration
(
seconds:
5
)),
builder:
(
context
,
snapshot
)
{
builder:
(
context
,
snapshot
)
{
if
(
snapshot
.
connectionState
==
ConnectionState
.
waiting
)
{
if
(
snapshot
.
connectionState
==
return
Container
();
// Placeholder widget while waiting
ConnectionState
.
waiting
)
{
}
else
{
return
Container
();
// Placeholder widget while waiting
return
TextButton
(
}
else
{
onPressed:
isProcessCheck
return
TextButton
(
?
null
onPressed:
isProcessCheck
:
()
async
{
?
null
print
(
"Click-button-cancel"
);
:
()
async
{
setState
(()
{
print
(
"Click-button-cancel"
);
isProcessCheck
=
true
;
setState
(()
{
});
isProcessCheck
=
true
;
try
{
});
bool
value
=
await
_cekStatus
();
try
{
if
(
value
)
{
bool
value
=
await
_cekStatus
();
isProcessGet
=
false
;
if
(
value
)
{
print
(
"pembayaran berhasil dilakukan"
);
isProcessGet
=
false
;
Navigator
.
pop
(
context
);
print
(
showPop
(
approvalCode
);
"pembayaran berhasil dilakukan"
);
}
else
{
Navigator
.
pop
(
context
);
await
AwesomeDialog
(
showPop
(
approvalCode
);
context:
context
,
}
else
{
dismissOnTouchOutside:
false
,
await
AwesomeDialog
(
dialogType:
DialogType
.
warning
,
context:
context
,
autoHide:
Duration
(
seconds:
3
),
dismissOnTouchOutside:
false
,
animType:
AnimType
.
rightSlide
,
dialogType:
DialogType
.
warning
,
headerAnimationLoop:
true
,
autoHide:
Duration
(
seconds:
3
),
title:
'Anda telah membatalkan transaksi'
,
animType:
AnimType
.
rightSlide
,
desc:
"You have canceled the transaction"
,
headerAnimationLoop:
true
,
).
show
().
then
((
value
)
{
title:
Navigator
.
of
(
context
).
pop
();
'Anda telah membatalkan transaksi'
,
timer
?.
cancel
();
desc:
dataQris
=
null
;
"You have canceled the transaction"
,
checkCountZero
=
false
;
).
show
().
then
((
value
)
{
isShowingDialog
=
true
;
Navigator
.
of
(
context
).
pop
();
_showTap
();
timer
?.
cancel
();
tapDial
();
dataQris
=
null
;
});
checkCountZero
=
false
;
}
isShowingDialog
=
true
;
}
catch
(
e
)
{
_showTap
();
// Handle any errors that occur during _cekStatus()
tapDial
();
}
finally
{
});
setState
(()
=>
isProcessCheck
=
false
);
}
}
catch
(
e
)
{
// Handle any errors that occur during _cekStatus()
}
finally
{
setState
(
()
=>
isProcessCheck
=
false
);
}
},
child:
ButtonQris
(
iconUrl:
'assets/cancel.png'
,
title:
'batalkan'
,
subtitle:
'cancel'
,
),
);
}
}
},
},
child:
ButtonQris
(
iconUrl:
'assets/cancel.png'
,
title:
'batalkan'
,
subtitle:
'cancel'
,
),
);
}
},
)),
)),
Visibility
(
Visibility
(
visible:
isShowingButton
,
visible:
isShowingButton
,
maintainState:
true
,
maintainState:
true
,
child:
FutureBuilder
(
child:
FutureBuilder
(
future:
Future
.
delayed
(
Duration
(
seconds:
5
)),
future:
Future
.
delayed
(
Duration
(
seconds:
5
)),
builder:
(
context
,
snapshot
){
builder:
(
context
,
snapshot
)
{
if
(
snapshot
.
connectionState
==
ConnectionState
.
waiting
){
if
(
snapshot
.
connectionState
==
return
Container
();
ConnectionState
.
waiting
)
{
}
else
{
return
Container
();
return
TextButton
(
}
else
{
onPressed:
isProcessCheck
return
TextButton
(
?
null
onPressed:
isProcessCheck
:
()
async
{
?
null
AwesomeDialog
(
:
()
async
{
context:
context
,
dialogType:
DialogType
.
info
,
animType:
AnimType
.
rightSlide
,
dismissOnTouchOutside:
false
,
autoHide:
Duration
(
seconds:
2
),
headerAnimationLoop:
true
,
title:
'Mohon Tunggu Sebentar ...'
,
titleTextStyle:
blackTextStyle
.
copyWith
(
fontSize:
20
,
fontWeight:
bold
,
),
desc:
"Please wait a moment ..."
,
descTextStyle:
greyTextStyle
.
copyWith
(
fontSize:
18
,
fontWeight:
light
,
),
).
show
().
then
((
value
)
async
{
print
(
"Click-button-saya-sudah-bayar"
);
if
(
isProcessCheck
)
return
;
setState
(()
=>
isProcessCheck
=
true
);
try
{
bool
result
=
await
_cekStatus
();
if
(
result
)
{
isProcessGet
=
false
;
}
setState
(()
{
if
(
result
)
{
isProcessCheck
=
true
;
print
(
"pembayaran berhasil dilakukan"
);
Navigator
.
pop
(
context
);
showPop
(
approvalCode
);
}
else
{
isProcessCheck
=
false
;
AwesomeDialog
(
AwesomeDialog
(
context:
context
,
context:
context
,
dialogType:
DialogType
.
error
,
dialogType:
DialogType
.
info
,
animType:
AnimType
.
rightSlide
,
animType:
AnimType
.
rightSlide
,
dismissOnTouchOutside:
false
,
dismissOnTouchOutside:
false
,
autoHide:
Duration
(
seconds:
2
),
autoHide:
Duration
(
seconds:
2
),
headerAnimationLoop:
true
,
headerAnimationLoop:
true
,
title:
'Belum Terbayar !'
,
title:
'Mohon Tunggu Sebentar ...'
,
desc:
"Not paid yet !"
,
titleTextStyle:
btnOkIcon:
Icons
.
cancel
,
blackTextStyle
.
copyWith
(
btnOkColor:
Colors
.
red
,
fontSize:
20
,
).
show
();
fontWeight:
bold
,
}
),
});
desc:
"Please wait a moment ..."
,
}
catch
(
e
)
{
descTextStyle:
print
(
"Error:
$e
"
);
greyTextStyle
.
copyWith
(
setState
(()
=>
isProcessCheck
=
false
);
fontSize:
18
,
}
fontWeight:
light
,
});
),
},
).
show
().
then
((
value
)
async
{
child:
ButtonQris
(
print
(
iconUrl:
'assets/check-mark.png'
,
"Click-button-saya-sudah-bayar"
);
title:
'Saya Sudah Bayar'
,
if
(
isProcessCheck
)
return
;
subtitle:
'i have already paid'
,
setState
(
),
()
=>
isProcessCheck
=
true
);
);
try
{
}
bool
result
=
await
_cekStatus
();
}
if
(
result
)
{
),
isProcessGet
=
false
;
}
setState
(()
{
if
(
result
)
{
isProcessCheck
=
true
;
print
(
"pembayaran berhasil dilakukan"
);
Navigator
.
pop
(
context
);
showPop
(
approvalCode
);
}
else
{
isProcessCheck
=
false
;
AwesomeDialog
(
context:
context
,
dialogType:
DialogType
.
error
,
animType:
AnimType
.
rightSlide
,
dismissOnTouchOutside:
false
,
autoHide:
Duration
(
seconds:
2
),
headerAnimationLoop:
true
,
title:
'Belum Terbayar !'
,
desc:
"Not paid yet !"
,
btnOkIcon:
Icons
.
cancel
,
btnOkColor:
Colors
.
red
,
).
show
();
}
});
}
catch
(
e
)
{
print
(
"Error:
$e
"
);
setState
(
()
=>
isProcessCheck
=
false
);
}
});
},
child:
ButtonQris
(
iconUrl:
'assets/check-mark.png'
,
title:
'Saya Sudah Bayar'
,
subtitle:
'i have already paid'
,
),
);
}
}),
),
),
// Time DI Menu Qris
// Time DI Menu Qris
Column
(
Column
(
...
@@ -2358,8 +2417,10 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
...
@@ -2358,8 +2417,10 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
animType:
AnimType
.
rightSlide
,
animType:
AnimType
.
rightSlide
,
autoHide:
Duration
(
seconds:
2
),
autoHide:
Duration
(
seconds:
2
),
headerAnimationLoop:
true
,
headerAnimationLoop:
true
,
title:
'Waktu pembayaran anda sudah habis !'
,
title:
desc:
"Your payment time has expired !"
,
'Waktu pembayaran anda sudah habis !'
,
desc:
"Your payment time has expired !"
,
btnOkIcon:
Icons
.
cancel
,
btnOkIcon:
Icons
.
cancel
,
btnOkColor:
Colors
.
red
)
btnOkColor:
Colors
.
red
)
.
show
()
.
show
()
...
@@ -2372,7 +2433,8 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
...
@@ -2372,7 +2433,8 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
setState
(()
{
setState
(()
{
if
(
result
)
{
if
(
result
)
{
isProcessGet
=
false
;
isProcessGet
=
false
;
print
(
"pembayaran berhasil dilakukan"
);
print
(
"pembayaran berhasil dilakukan"
);
Navigator
.
pop
(
context
);
Navigator
.
pop
(
context
);
showPop
(
approvalCode
);
showPop
(
approvalCode
);
}
else
{
}
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment