Commit afc75ab7 authored by Izol's avatar Izol

simply #3

parent dbead1a0
...@@ -101,6 +101,7 @@ class StartService { ...@@ -101,6 +101,7 @@ class StartService {
String approvalCode, String approvalCode,
String paymentMethod, String paymentMethod,
String paymentProvider, String paymentProvider,
String paymentNotes,
) async { ) async {
var result; var result;
try { try {
...@@ -112,6 +113,7 @@ class StartService { ...@@ -112,6 +113,7 @@ class StartService {
'approval_code': approvalCode, 'approval_code': approvalCode,
'payment_method': paymentMethod, 'payment_method': paymentMethod,
'payment_provider': paymentProvider, 'payment_provider': paymentProvider,
'payment_notes': paymentNotes,
}); });
} catch (error) { } catch (error) {
result = error.toString(); result = error.toString();
......
...@@ -423,6 +423,7 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback { ...@@ -423,6 +423,7 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
samReport, samReport,
paymentMethod, paymentMethod,
paymentProvider, paymentProvider,
paymentNotes,
metodeBayar, metodeBayar,
status; status;
...@@ -430,16 +431,20 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback { ...@@ -430,16 +431,20 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
infoMap = jsonDecode(info); infoMap = jsonDecode(info);
lastBalance = infoMap['balance'].toString(); lastBalance = infoMap['balance'].toString();
samReport = infoMap['report'].toString(); samReport = infoMap['report'].toString();
paymentMethod = 'QRIS'; paymentMethod = 'Qris';
// paymentProvider = PreferencesHelper.getString('provider');
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'); tid = PreferencesHelper.getString('outletname');
tid = tid.substring(tid.length -4); tid = tid.substring(tid.length -4);
if (int.parse(lastBalance) > int.parse(prevBalance!)) { if (int.parse(lastBalance) > int.parse(prevBalance!)) {
countMax = 0; countMax = 0;
var result = await StartService.topUpConfirm(cardNumber, lastBalance, tid, var result = await StartService.topUpConfirm(cardNumber, lastBalance, tid,
samReport, approvalCode, paymentMethod, paymentProvider); samReport, approvalCode, paymentMethod, paymentProvider, paymentNotes);
print('topUpConfirm result: $result'); print('topUpConfirm result: $result');
String readerDate, String readerDate,
...@@ -942,6 +947,9 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback { ...@@ -942,6 +947,9 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
), ),
).show().then((value) { ).show().then((value) {
denom(outletName, infoCard); denom(outletName, infoCard);
// isShowingDialog = false;
// if (timer != null) timer?.cancel();
// tapIdle();
}); });
} }
if (duration == 0 && !isShowingDialog) { if (duration == 0 && !isShowingDialog) {
...@@ -954,8 +962,6 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback { ...@@ -954,8 +962,6 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
}); });
} }
void tapDial() async { void tapDial() 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();
...@@ -1239,19 +1245,29 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback { ...@@ -1239,19 +1245,29 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
showDialog( showDialog(
context: context, context: context,
builder: (context) { builder: (context) {
Future.delayed(Duration(seconds: int.parse(idle)), () {
Navigator.of(context).pop(true);
setState(() {
isShowingDialog = true;
if (timer != null) timer?.cancel();
dataQris = null;
_showTap();
tapIdle();
});// Menutup dialog setelah durasi tertentu
});
return StatefulBuilder(builder: (context, StateSetter setState) { return StatefulBuilder(builder: (context, StateSetter setState) {
return Container( return Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: lightBackgroundColor image: const DecorationImage(
fit: BoxFit.cover,
image: AssetImage(
'assets/img_bg_card.png',
), ),
child: Stack(
children: [
BackdropFilter(
filter: ImageFilter.blur(sigmaX: 5, sigmaY: 5),
child: Container(
color: Colors.black.withOpacity(0.2),
), ),
color: purpleColor
), ),
child: Stack(
children: [
Center( Center(
child: SingleChildScrollView( child: SingleChildScrollView(
child: AlertDialog( child: AlertDialog(
...@@ -1269,16 +1285,15 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback { ...@@ -1269,16 +1285,15 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
), ),
), ),
width: 1100, width: 1100,
margin: margin: const EdgeInsets.symmetric(vertical: 10, horizontal: 20),
const EdgeInsets.symmetric(vertical: 10, horizontal: 0),
child: Row( child: Row(
children: [ children: [
Align( Align(
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
Navigator.pop(context);
setState(() { setState(() {
Navigator.pop(context);
timer?.cancel(); timer?.cancel();
dataQris = null; dataQris = null;
isShowingDialog = true; isShowingDialog = true;
...@@ -1432,7 +1447,9 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback { ...@@ -1432,7 +1447,9 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
], ],
), ),
), ),
Column( Container(
padding: EdgeInsets.symmetric(horizontal: 17),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox(height: 15,), SizedBox(height: 15,),
...@@ -1603,10 +1620,11 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback { ...@@ -1603,10 +1620,11 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
), ),
], ],
), ),
),
SizedBox(height: 30), SizedBox(height: 30),
Column( Container(
children: [ margin: const EdgeInsets.only(right:300, left:300),
Row( child: Row(
children: [ children: [
Expanded( Expanded(
child: CustomFilledButton( child: CustomFilledButton(
...@@ -1667,8 +1685,35 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback { ...@@ -1667,8 +1685,35 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
), ),
], ],
), ),
),
SizedBox(height: 20),
Positioned(
bottom: 20,
right: 0,
child: Stack(
alignment: Alignment.center,
children: [
ValueListenableBuilder(
valueListenable: idleDuration,
builder: (context, value, child) => CircularProgressIndicator(
strokeWidth: 5,
value: (idleDuration.value.toDouble()) / _maxDuration,
valueColor: AlwaysStoppedAnimation<Color>(Colors.blue),
),
),
RotatedBox(
quarterTurns: 4,
child: ValueListenableBuilder(
valueListenable: idleDuration,
builder: (context, value, child) => Text(
value.toString(),
style: TextStyle(fontSize: 18),
),
),
),
], ],
), ),
),
], ],
), ),
), ),
......
...@@ -103,6 +103,8 @@ class _SplashPageState extends State<SplashPage> with TickerProviderStateMixin{ ...@@ -103,6 +103,8 @@ class _SplashPageState extends State<SplashPage> with TickerProviderStateMixin{
checkActivation(); checkActivation();
}); });
} }
void navigationToSetConfig() { void navigationToSetConfig() {
Navigator.pushReplacement( Navigator.pushReplacement(
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