Merge branch 'main' of https://gitea.71dev.com/manasit/Neo_wallet
# Conflicts: # neowallet_mobile/lib/Pay/PayQrDialogV2.dart
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
import 'package:cathaypay_mobile/Home/HomePage.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:saver_gallery/saver_gallery.dart';
|
||||
import 'package:screenshot/screenshot.dart';
|
||||
|
||||
import '../api/api.dart';
|
||||
import '../model/profile_model.dart';
|
||||
import '../utils/utils.dart';
|
||||
|
||||
class PayQrDialogV2 extends StatefulWidget {
|
||||
const PayQrDialogV2(
|
||||
@@ -54,6 +57,8 @@ class PayQrDialogV2 extends StatefulWidget {
|
||||
|
||||
class _PayQrDialogV2State extends State<PayQrDialogV2> {
|
||||
@override
|
||||
ScreenshotController screenshotController = ScreenshotController();
|
||||
|
||||
void initState() {
|
||||
getProfile(context);
|
||||
super.initState();
|
||||
@@ -67,324 +72,371 @@ class _PayQrDialogV2State extends State<PayQrDialogV2> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
padding: const EdgeInsets.only(left: 20, right: 20),
|
||||
margin: const EdgeInsets.symmetric(vertical: 20),
|
||||
child: Card(
|
||||
color: Color(0xfffbfbfb),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(10.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
height: 150,
|
||||
width: 180,
|
||||
child: Image(
|
||||
image: AssetImage('images/neopay_logo.png'),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"Approved or completed successfully",
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w300,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"ดำเนินการโอน/จ่ายสำเร็จ",
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w300,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"จำนวนเงิน/Amount ฿" + widget.price,
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w300,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: 80,
|
||||
width: 180,
|
||||
child: Image(
|
||||
image: AssetImage('images/prompt.png'),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 15,
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage('images/neo_backgroup.png'),
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
return Screenshot(
|
||||
controller: screenshotController,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(left: 20, right: 20),
|
||||
child: Card(
|
||||
color: Color(0xfffbfbfb),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(10.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
height: 150,
|
||||
width: 180,
|
||||
child: Image(
|
||||
image: AssetImage('images/neopay_logo.png'),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
"ผู้รับเงิน",
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w300,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
widget.name,
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
Text(
|
||||
"Approved or completed successfully",
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w300,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"ดำเนินการโอน/จ่ายสำเร็จ",
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w300,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"จำนวนเงิน/Amount ฿" + widget.price,
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w300,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: 80,
|
||||
width: 180,
|
||||
child: Image(
|
||||
image: AssetImage('images/prompt.png'),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 15,
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage('images/neo_backgroup.png'),
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
"Receiver",
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w300,
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
"ผู้รับเงิน",
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w300,
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
widget.name_en,
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
"ธนาคารปลายทาง",
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w300,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
widget.bankName,
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
"referenceNo",
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w300,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
widget.referenceNo,
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
"วันที่ เวลา ทำรายการ",
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w300,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
widget.slipDateTime,
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
"feeAmount",
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w300,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"0.00",
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
"Sender",
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w300,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
profile?.fullName ?? "",
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
"Wallet ID",
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w300,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
profile?.phoneNumber ?? "",
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
Text(
|
||||
"senderCom.",
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w300,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Text(
|
||||
widget.senderCom,
|
||||
textAlign: TextAlign.end,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
Text(
|
||||
widget.name,
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
"Receiver",
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w300,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
"lookref",
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w300,
|
||||
Text(
|
||||
widget.name_en,
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
"ธนาคารปลายทาง",
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w300,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
widget.bankName,
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
"referenceNo",
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w300,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
widget.referenceNo,
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
"วันที่ เวลา ทำรายการ",
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w300,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
widget.slipDateTime,
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
"feeAmount",
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w300,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"0.00",
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
"Sender",
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w300,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
profile?.fullName ?? "",
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
"Wallet ID",
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w300,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
profile?.phoneNumber ?? "",
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
Text(
|
||||
"senderCom.",
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w300,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Text(
|
||||
widget.senderCom,
|
||||
textAlign: TextAlign.end,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
"lookref",
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w300,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
widget.transactionId,
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
)),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Text(
|
||||
"Transfer / Payment from Bangkok Bank PromptPay",
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w300,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
// InkWell(
|
||||
// onTap: () async {
|
||||
// Navigator.popUntil(context, ModalRoute.withName('/HomePage'));
|
||||
// Navigator.pushReplacementNamed(context, "/HomePage");
|
||||
// },
|
||||
// child: Container(
|
||||
// margin: EdgeInsets.only(top: 20, bottom: 10),
|
||||
// width: MediaQuery.of(context).size.width,
|
||||
// decoration: BoxDecoration(
|
||||
// borderRadius: BorderRadius.circular(40),
|
||||
// color: Color(0xff9d001b),
|
||||
// ),
|
||||
// padding: const EdgeInsets.symmetric(
|
||||
// horizontal: 10,
|
||||
// vertical: 12,
|
||||
// ),
|
||||
// child: Text(
|
||||
// "ปิด",
|
||||
// textAlign: TextAlign.center,
|
||||
// style: GoogleFonts.kanit(
|
||||
// color: Colors.white,
|
||||
// fontSize: 20,
|
||||
// fontWeight: FontWeight.w500,
|
||||
// ),
|
||||
// ),
|
||||
// ),),
|
||||
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,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
widget.transactionId,
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
)),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Text(
|
||||
"Transfer / Payment from Bangkok Bank PromptPay",
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w300,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
InkWell(
|
||||
onTap: () async {
|
||||
Navigator.popUntil(context, ModalRoute.withName('/HomePage'));
|
||||
Navigator.pushReplacementNamed(context, "/HomePage");
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 20, bottom: 10),
|
||||
width: MediaQuery.of(context).size.width,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(40),
|
||||
color: Color(0xff9d001b),
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
vertical: 12,
|
||||
),
|
||||
child: Text(
|
||||
"ปิด",
|
||||
textAlign: TextAlign.center,
|
||||
style: GoogleFonts.kanit(
|
||||
color: Colors.white,
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user