bug fixed

This commit is contained in:
nutchayut
2025-01-08 21:57:03 +07:00
parent 700e63c054
commit 820cd73b88
31 changed files with 73 additions and 181 deletions

View File

@@ -1,5 +1,6 @@
import 'dart:math';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:saver_gallery/saver_gallery.dart';
@@ -252,6 +253,15 @@ class _TransferCathayPayDialogState extends State<TransferCathayPayDialog> {
),
InkWell(
onTap: () async {
screenshotController
.capture(delay: Duration(milliseconds: 10))
.then((capturedImage) async {
String fileName = "neopay_${DateTime.now().millisecondsSinceEpoch}.jpg";
SaverGallery.saveImage(capturedImage!, fileName: fileName, skipIfExists: false);
Utils.showAlertDialog(context, "บันทึกสำเร็จ");
}).catchError((onError) {
print(onError);
});
Navigator.popUntil(
context, ModalRoute.withName('/HomePage'));
},
@@ -275,7 +285,7 @@ class _TransferCathayPayDialogState extends State<TransferCathayPayDialog> {
width: 106,
height: 32,
child: Text(
"ปิด",
"บันทึกและปิด".tr(),
textAlign: TextAlign.center,
style: GoogleFonts.kanit(
color: Colors.white,
@@ -288,55 +298,7 @@ class _TransferCathayPayDialogState extends State<TransferCathayPayDialog> {
),
),
),
InkWell(
onTap: () async {
screenshotController
.capture(delay: Duration(milliseconds: 10))
.then((capturedImage) async {
String fileName = "neopay_${DateTime.now().millisecondsSinceEpoch}.jpg";
SaverGallery.saveImage(capturedImage!, fileName: fileName, skipIfExists: false);
Utils.showAlertDialog(context, "บันทึกสำเร็จ");
}).catchError((onError) {
print(onError);
});
},
child: Container(
margin: EdgeInsets.only(top: 20, bottom: 20),
width: MediaQuery
.of(context)
.size
.width,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(40),
color: Color(0xff9d001b),
),
padding: const EdgeInsets.symmetric(
horizontal: 10,
vertical: 12,
),
child: Row(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
width: 106,
height: 32,
child: Text(
"บันทึกสลิป",
textAlign: TextAlign.center,
style: GoogleFonts.kanit(
color: Colors.white,
fontSize: 20,
fontWeight: FontWeight.w500,
),
),
),
],
),
),
),
],
),
),

View File

@@ -4,6 +4,7 @@ import 'dart:typed_data';
import 'package:cathaypay_mobile/Home/HomePage.dart';
import 'package:cathaypay_mobile/utils/utils.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:saver_gallery/saver_gallery.dart';
@@ -243,6 +244,15 @@ class _TransferPromtptPayDialogState extends State<TransferPromtptPayDialog> {
InkWell(
onTap: () {
screenshotController
.capture(delay: Duration(milliseconds: 10))
.then((capturedImage) async {
String fileName = "neopay_${DateTime.now().millisecondsSinceEpoch}.jpg";
SaverGallery.saveImage(capturedImage!, fileName: fileName, skipIfExists: false);
Utils.showAlertDialog(context, "บันทึกสำเร็จ");
}).catchError((onError) {
print(onError);
});
Navigator.popUntil(
context, ModalRoute.withName('/HomePage'));
},
@@ -259,7 +269,7 @@ class _TransferPromtptPayDialogState extends State<TransferPromtptPayDialog> {
),
child: Center(
child: Text(
"ปิด",
"บันทึกและปิด".tr(),
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
@@ -268,55 +278,7 @@ class _TransferPromtptPayDialogState extends State<TransferPromtptPayDialog> {
),
)),
)),
InkWell(
onTap: () async {
screenshotController
.capture(delay: Duration(milliseconds: 10))
.then((capturedImage) async {
String fileName = "neopay_${DateTime.now().millisecondsSinceEpoch}.jpg";
SaverGallery.saveImage(capturedImage!, fileName: fileName, skipIfExists: false);
Utils.showAlertDialog(context, "บันทึกสำเร็จ");
}).catchError((onError) {
print(onError);
});
},
child: Container(
margin: EdgeInsets.only(top: 20, bottom: 20),
width: MediaQuery
.of(context)
.size
.width,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(40),
color: Color(0xff9d001b),
),
padding: const EdgeInsets.symmetric(
horizontal: 10,
vertical: 12,
),
child: Row(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
width: 106,
height: 32,
child: Text(
"บันทึกสลิป",
textAlign: TextAlign.center,
style: GoogleFonts.kanit(
color: Colors.white,
fontSize: 20,
fontWeight: FontWeight.w500,
),
),
),
],
),
),
),
],
),
),

View File

@@ -37,7 +37,7 @@ class _TopUpHistoryState extends State<TransferHistory> {
"paymentChannel": "",
"createDatefrom": start,
"createDateto": end,
"requestName": "",
"requestName": profile!.fullName,
"fullName": ""
// "id": "",
// "payeeUserAccountId": "",
@@ -139,14 +139,14 @@ class _TopUpHistoryState extends State<TransferHistory> {
),
),
Text(
"To ${transactions.qrId.toString().split('|').toList().length >= 3 ?transactions.qrId.toString().split('|').toList()[3].startsWith('0') ? transactions.qrId.toString().split('|').toList()[3]:"" : "" }" ?? "",
"To ${transactions.payeeName != null ? transactions.payeeName : transactions.qrId.toString().split('|').toList().length >= 3 ?transactions.qrId.toString().split('|').toList()[3].startsWith('0') ? transactions.qrId.toString().split('|').toList()[3]: "" : "" }" ?? "",
style: TextStyle(
color: Color(0xff65676b),
fontSize: 16,
),
),
Text(
transactions.phoneNumber ?? "",
"From ${transactions.phoneNumber}" ?? "",
style: TextStyle(
color: Color(0xff65676b),
fontSize: 16,