Commit afc75ab7 authored by Izol's avatar Izol

simply #3

parent dbead1a0
......@@ -101,6 +101,7 @@ class StartService {
String approvalCode,
String paymentMethod,
String paymentProvider,
String paymentNotes,
) async {
var result;
try {
......@@ -112,6 +113,7 @@ class StartService {
'approval_code': approvalCode,
'payment_method': paymentMethod,
'payment_provider': paymentProvider,
'payment_notes': paymentNotes,
});
} catch (error) {
result = error.toString();
......
......@@ -423,6 +423,7 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
samReport,
paymentMethod,
paymentProvider,
paymentNotes,
metodeBayar,
status;
......@@ -430,16 +431,20 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
infoMap = jsonDecode(info);
lastBalance = infoMap['balance'].toString();
samReport = infoMap['report'].toString();
paymentMethod = 'QRIS';
// paymentProvider = PreferencesHelper.getString('provider');
paymentMethod = 'Qris';
var infoPaymentNotes = jsonDecode(info);
var reffNo = trxId.toString();
paymentProvider = '';
paymentNotes = "reffNo: $reffNo\nprovider: $paymentNotes";
print("ini adalag test hasil payment notes:$paymentNotes");
tid = PreferencesHelper.getString('outletname');
tid = tid.substring(tid.length -4);
if (int.parse(lastBalance) > int.parse(prevBalance!)) {
countMax = 0;
var result = await StartService.topUpConfirm(cardNumber, lastBalance, tid,
samReport, approvalCode, paymentMethod, paymentProvider);
samReport, approvalCode, paymentMethod, paymentProvider, paymentNotes);
print('topUpConfirm result: $result');
String readerDate,
......@@ -942,6 +947,9 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
),
).show().then((value) {
denom(outletName, infoCard);
// isShowingDialog = false;
// if (timer != null) timer?.cancel();
// tapIdle();
});
}
if (duration == 0 && !isShowingDialog) {
......@@ -954,8 +962,6 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
});
}
void tapDial() async {
Future.delayed(const Duration(milliseconds: 500), () async {
var isTap = await StartService.getCard();
......@@ -1239,19 +1245,29 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
showDialog(
context: 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 Container(
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(
child: SingleChildScrollView(
child: AlertDialog(
......@@ -1269,16 +1285,15 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
),
),
width: 1100,
margin:
const EdgeInsets.symmetric(vertical: 10, horizontal: 0),
margin: const EdgeInsets.symmetric(vertical: 10, horizontal: 20),
child: Row(
children: [
Align(
alignment: Alignment.topLeft,
child: GestureDetector(
onTap: () {
Navigator.pop(context);
setState(() {
Navigator.pop(context);
timer?.cancel();
dataQris = null;
isShowingDialog = true;
......@@ -1432,7 +1447,9 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
],
),
),
Column(
Container(
padding: EdgeInsets.symmetric(horizontal: 17),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: 15,),
......@@ -1603,10 +1620,11 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
),
],
),
),
SizedBox(height: 30),
Column(
children: [
Row(
Container(
margin: const EdgeInsets.only(right:300, left:300),
child: Row(
children: [
Expanded(
child: CustomFilledButton(
......@@ -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{
checkActivation();
});
}
void navigationToSetConfig() {
Navigator.pushReplacement(
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