Files
Neo_wallet/neowallet_mobile/lib/Pay/PayQrDialogV2.dart
nutchayut a02c6b91a8 bug fixed
2024-12-27 16:45:29 +07:00

367 lines
14 KiB
Dart

import 'package:cathaypay_mobile/Home/HomePage.dart';
import 'package:cathaypay_mobile/utils/utils.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import '../api/api.dart';
import '../model/profile_model.dart';
class PayQrDialogV2 extends StatefulWidget {
const PayQrDialogV2({Key? key, required this.name, required this.phone, required this.transactionId, required this.price, required this.name_en, required this.bankName, required this.referenceNo, required this.slipDateTime, required this.bill}) : super(key: key);
final String name;
final String name_en;
final String phone;
final String transactionId;
final String price;
final String bankName;
final String referenceNo;
final String slipDateTime;
final String bill;
// "slipTitleTH": "ตรวจสอบ การชำระเงิน",
// "slipTitleEN": "payment verification",
// "slipDateTime": "27 Dec 24 02:23",
// "slipAmount": "1.00",
// "slipChannel": "PromptPay",
// "senderName": "Administrator",
// "senderCompanyTH": "บริษัท คาเธ่ย์ อินเตอร์เนชั่นแนล ช๊อปปิ้ง เซ็นเตอร์",
// "senderCompanyEN": "Cathay International Shopping Center",
// "walletID": "300001019239589",
// "referenceNo": "436202657895",
// "referenceName": "หมายเลขอ้างอิง",
// "receiverNameTH": "นาย บรรณกิจจา เชื้อยูนาน",
// "receiverNameEN": "BANAKITCHA CHUAUNAN",
// "promptpayID": "0922465952",
// "bankCode": "004",
// "bankName": "KBANK",
// "lookref": "300241227092356809704383"
@override
State<PayQrDialogV2> createState() => _PayQrDialogV2State();
}
class _PayQrDialogV2State extends State<PayQrDialogV2> {
@override
void initState() {
getProfile(context);
super.initState();
}
getProfile(BuildContext context) {
Api.get(context, Api.profile).then((value) => {
if (value != null) {profile = Profile.fromJson(value["profile"])} else {}
});
}
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.only(left: 20, right: 20),
child: Column(mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [
// Container(
// margin: EdgeInsets.only(bottom: 10),
// height: 80,
// width: 80,
// child: Image.asset(
// 'assets/images/LOGO.gif',
// height: 120,
// width: 120,
// )),
Card(
color: Color(0xfffbfbfb),
child: Padding(
padding: const EdgeInsets.all(10.0),
child: Column(
children: [
Container(height: 180,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,
),
),
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,
),
)
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"Receiver",
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(
"retrievalReferenceNumber",
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,
),
)
],
),SizedBox(
height: 35,
),
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(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"เลขที่ทำรายการ",
style: TextStyle(
color: Color(0xff65676b),
fontSize: 14,
fontWeight: FontWeight.w300,
),
),
Text(
widget.bill,
style: TextStyle(
color: Color(0xff65676b),
fontSize: 14,
fontWeight: FontWeight.w600,
),
)
],
),
],)
),
SizedBox(height: 15,),
InkWell(
onTap: () async {
Navigator.popUntil(context, ModalRoute.withName('/HomePage'));
Navigator.pushReplacementNamed(context, "/HomePage");
},
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,
),
),
),
],
),
),
),
],
),
),
),
SizedBox(
height: 20,
),
]),
);
}
}