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
34ddac0d
Commit
34ddac0d
authored
May 23, 2023
by
Izol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fixing tap card
parent
29812bae
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
102 additions
and
27 deletions
+102
-27
build.gradle
android/build.gradle
+1
-1
home_page.dart
lib/ui/pages/home_page.dart
+101
-26
No files found.
android/build.gradle
View file @
34ddac0d
...
@@ -20,7 +20,7 @@ buildscript {
...
@@ -20,7 +20,7 @@ buildscript {
allprojects
{
allprojects
{
repositories
{
repositories
{
maven
{
maven
{
url
"https://mobile-repo.mdd.co.id
:8081
/artifactory/android-library/"
url
"https://mobile-repo.mdd.co.id/artifactory/android-library/"
allowInsecureProtocol
=
true
allowInsecureProtocol
=
true
credentials
{
credentials
{
username
=
"admin"
username
=
"admin"
...
...
lib/ui/pages/home_page.dart
View file @
34ddac0d
...
@@ -89,6 +89,8 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
...
@@ -89,6 +89,8 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
Color
_tapColor2
=
Colors
.
grey
;
Color
_tapColor2
=
Colors
.
grey
;
Color
_tapColor3
=
Colors
.
grey
;
Color
_tapColor3
=
Colors
.
grey
;
int
_activeContainerIndex
=
1
;
int
_activeContainerIndex
=
1
;
int
callInit
=
10
;
int
callBalanceInit
=
10
;
double
_downloadSpeed
=
0
;
double
_downloadSpeed
=
0
;
bool
checkCountZero
=
false
;
bool
checkCountZero
=
false
;
bool
isDenomDialogShowing
=
false
;
bool
isDenomDialogShowing
=
false
;
...
@@ -455,9 +457,28 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
...
@@ -455,9 +457,28 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
status
;
status
;
info
=
await
StartService
.
topupBalanceCard
(
cardNumber
,
int
.
parse
(
amount
));
info
=
await
StartService
.
topupBalanceCard
(
cardNumber
,
int
.
parse
(
amount
));
infoMap
=
jsonDecode
(
info
);
// if (info == null){
lastBalance
=
infoMap
[
'balance'
].
toString
();
// tapBalance();
samReport
=
infoMap
[
'report'
].
toString
();
// return "";
// }
// if(info.toString().contains("{"))
// infoMap = jsonDecode(info);
// lastBalance = infoMap['balance'].toString();
// samReport = infoMap['report'].toString();
if
(
info
==
null
)
{
tapBalance
();
return
""
;
}
if
(
info
.
toString
().
contains
(
"{"
))
{
infoMap
=
jsonDecode
(
info
);
lastBalance
=
infoMap
[
'balance'
].
toString
();
samReport
=
infoMap
[
'report'
].
toString
();
}
else
{
// Handle ketika info tidak mengandung data JSON
tapBalance
();
return
""
;
}
paymentMethod
=
'Qris'
;
paymentMethod
=
'Qris'
;
var
infoPaymentNotes
=
jsonDecode
(
info
);
var
infoPaymentNotes
=
jsonDecode
(
info
);
...
@@ -649,7 +670,7 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
...
@@ -649,7 +670,7 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
_getInfoBeforeTopup
(
var
info
)
{
_getInfoBeforeTopup
(
var
info
)
{
setState
(()
{
setState
(()
{
countMax
+=
1
;
countMax
+=
1
;
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"
;
tapBalance
();
tapBalance
();
...
@@ -1037,6 +1058,7 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
...
@@ -1037,6 +1058,7 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
});
});
}
}
void
tapBalance
()
async
{
void
tapBalance
()
async
{
Future
.
delayed
(
const
Duration
(
milliseconds:
500
),
()
async
{
Future
.
delayed
(
const
Duration
(
milliseconds:
500
),
()
async
{
var
isTap
=
await
StartService
.
getCard
();
var
isTap
=
await
StartService
.
getCard
();
...
@@ -1044,28 +1066,81 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
...
@@ -1044,28 +1066,81 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
var
infoMap
=
jsonDecode
(
isTap
);
var
infoMap
=
jsonDecode
(
isTap
);
_getInfoBeforeTopup
(
isTap
);
_getInfoBeforeTopup
(
isTap
);
}
catch
(
e
)
{
}
catch
(
e
)
{
print
(
"Error
$isTap
"
);
if
(
isTap
==
"Card Not Found"
)
{
AwesomeDialog
(
print
(
"Card Not Found"
);
context:
context
,
AwesomeDialog
(
dialogType:
DialogType
.
info
,
context:
context
,
animType:
AnimType
.
rightSlide
,
dialogType:
DialogType
.
info
,
dismissOnTouchOutside:
false
,
animType:
AnimType
.
rightSlide
,
headerAnimationLoop:
true
,
dismissOnTouchOutside:
false
,
title:
'Pastikan Wristband Anda Tertempel Di Reader !'
,
headerAnimationLoop:
true
,
titleTextStyle:
blackTextStyle
.
copyWith
(
title:
'Pastikan Wristband Anda Tertempel Di Reader!'
,
fontSize:
20
,
titleTextStyle:
blackTextStyle
.
copyWith
(
fontWeight:
bold
,
fontSize:
20
,
),
fontWeight:
bold
,
desc:
"Make sure your wristband is attached to the reader !"
,
),
descTextStyle:
greyTextStyle
.
copyWith
(
desc:
"Make sure your wristband is attached to the reader!"
,
fontSize:
18
,
descTextStyle:
greyTextStyle
.
copyWith
(
fontWeight:
light
,
fontSize:
18
,
),
fontWeight:
light
,
btnOkOnPress:
()
{
),
tapBalance
();
btnOkOnPress:
()
{
},
countMax
=
0
;
btnOkColor:
Colors
.
blue
)
tapBalance
();
.
show
();
},
btnOkColor:
Colors
.
blue
,
).
show
();
}
else
if
(
isTap
==
"Error Get Card Type"
){
print
(
"Error Get Card Type"
);
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
==
"CardInfoError: 5001"
){
print
(
"CardInfoError: 5001"
);
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
{
print
(
"Error
$isTap
"
);
}
}
}
});
});
}
}
...
...
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