Merge branch 'main' of https://gitea.71dev.com/manasit/Neo_wallet
# Conflicts: # neowallet_mobile/lib/Pay/PayQrDialogV2.dart
This commit is contained in:
@@ -16,6 +16,7 @@ import '../Home/home_bottom_menu_widget.dart';
|
||||
import '../api/api.dart';
|
||||
import '../utils/color_custom.dart';
|
||||
import '../utils/utils.dart';
|
||||
import 'GetPaidHistory.dart';
|
||||
|
||||
class GetPaidPage extends StatefulWidget {
|
||||
const GetPaidPage({Key? key}) : super(key: key);
|
||||
@@ -160,7 +161,7 @@ class _GetPaidPageState extends State<GetPaidPage> {
|
||||
height: 1,
|
||||
),
|
||||
_is_history
|
||||
? Expanded(child: TransferHistory())
|
||||
? Expanded(child: GetPaidHistory())
|
||||
: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
|
||||
182
neowallet_mobile/lib/GetPaid/GetPaidHistory.dart
Normal file
182
neowallet_mobile/lib/GetPaid/GetPaidHistory.dart
Normal file
@@ -0,0 +1,182 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:cathaypay_mobile/Home/HomePage.dart';
|
||||
import 'package:cathaypay_mobile/TopUp/topup_amout.dart';
|
||||
import 'package:cathaypay_mobile/TopUp/topup_my_qr.dart';
|
||||
import 'package:cathaypay_mobile/utils/utils.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
|
||||
import '../Home/home_bottom_menu_widget.dart';
|
||||
import '../api/api.dart';
|
||||
import '../model/transaction_model.dart';
|
||||
|
||||
|
||||
|
||||
class GetPaidHistory extends StatefulWidget {
|
||||
const GetPaidHistory({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<GetPaidHistory> createState() => _GetPaidHistoryState();
|
||||
}
|
||||
|
||||
class _GetPaidHistoryState extends State<GetPaidHistory> {
|
||||
List<TransactionsV4> listTrans = [];
|
||||
|
||||
getTransaction() {
|
||||
listTrans.clear();
|
||||
var date = DateTime.now();
|
||||
var start = DateFormat('yyyy-MM-dd').format(DateTime.now());
|
||||
var end = DateFormat('yyyy-MM-dd').format(DateTime(date.year - 1, date.month, date.day));
|
||||
var param = jsonEncode(<dynamic, dynamic>{
|
||||
"id": "",
|
||||
"requestUserID": "",
|
||||
"invoiceId": "",
|
||||
"referencE1": "",
|
||||
"referencE2": "",
|
||||
// "paymentStatus": "WALLETADDED",
|
||||
"paymentStatus": "CONFIRM",
|
||||
"paymentChannel": "TRANSFERTO",
|
||||
"createDatefrom": end,
|
||||
"createDateto": start,
|
||||
"requestName": "",
|
||||
"payeeName": profile?.fullName,
|
||||
"payerName": "",
|
||||
"fullName": ""
|
||||
});
|
||||
|
||||
Api.postAdmin(context, Api.getTransactionTopUpV4, param).then((value) => {
|
||||
if (value != null)
|
||||
{
|
||||
print("postAdmin $value"),
|
||||
value.forEach((v) {
|
||||
listTrans.add(TransactionsV4.fromJson(v));
|
||||
print("postAdmin ");
|
||||
}),
|
||||
refresh()
|
||||
}
|
||||
else
|
||||
{
|
||||
print("postAdmin nullllll"),
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
refresh() {
|
||||
setState(() {});
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
getTransaction();
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Expanded(
|
||||
child: ListView.builder(
|
||||
itemCount: listTrans.length,
|
||||
shrinkWrap: true,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
TransactionsV4 transactions = listTrans[index];
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(10.0),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
Utils.convertDateToDay(transactions.updateDate ?? "", context),
|
||||
style: GoogleFonts.kanit(
|
||||
color: Color(0xff565656),
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
color: Colors.grey.shade100,
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
transactions.paymentChannel ?? "",
|
||||
style: GoogleFonts.kanit(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w300,
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
Text(
|
||||
"${transactions.amount ?? ""} ${"Baht".tr()}",
|
||||
textAlign: TextAlign.right,
|
||||
style: GoogleFonts.kanit(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 16,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Text(
|
||||
"From ${transactions.payerName}" ?? "",
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
Utils.convertDateToTime(transactions.phoneNumber ?? ""),
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w300,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
Utils.convertDateToTime(transactions.updateDate ?? ""),
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w300,
|
||||
),
|
||||
),
|
||||
/* Text(
|
||||
Utils.convertDateToTime("Trans.ID. ${transactions.ePaymentTransactionID}" ?? ""),
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w300,
|
||||
),
|
||||
),*/
|
||||
// Row(
|
||||
// children: [
|
||||
// Spacer(),
|
||||
// Icon(
|
||||
// Icons.keyboard_arrow_down,
|
||||
// color: Colors.grey.shade400,
|
||||
// size: 30,
|
||||
// )
|
||||
// ],
|
||||
// ),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}));
|
||||
}
|
||||
}
|
||||
157
neowallet_mobile/lib/Home/ChangeEmail.dart
Normal file
157
neowallet_mobile/lib/Home/ChangeEmail.dart
Normal file
@@ -0,0 +1,157 @@
|
||||
import 'package:cathaypay_mobile/Home/all_menu.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:cathaypay_mobile/PinCode.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
import '../utils/color_custom.dart';
|
||||
|
||||
TextEditingController _current_email = TextEditingController();
|
||||
TextEditingController _new_email = TextEditingController();
|
||||
|
||||
class ChangeEmailPage extends StatefulWidget {
|
||||
const ChangeEmailPage({super.key});
|
||||
|
||||
@override
|
||||
State<ChangeEmailPage> createState() => _ChangeEmailPageState();
|
||||
}
|
||||
|
||||
class _ChangeEmailPageState extends State<ChangeEmailPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// extendBodyBehindAppBar: true,
|
||||
|
||||
appBar: AppBar(
|
||||
backgroundColor: Colors.white,
|
||||
leading: CupertinoButton(
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: const Icon(
|
||||
Icons.arrow_back,
|
||||
color: Colors.black54,
|
||||
),
|
||||
),
|
||||
elevation: 0,
|
||||
centerTitle: true,
|
||||
title: Text(
|
||||
"เปลี่ยนอีเมล".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: GoogleFonts.kanit(
|
||||
color: Colors.black,
|
||||
fontSize: 20,
|
||||
),
|
||||
),
|
||||
),
|
||||
body: SafeArea(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(20.0),
|
||||
child: Container(height: MediaQuery.of(context).size.height,
|
||||
child: Column(mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Text(
|
||||
"อีเมลปัจจุบัน".tr(),
|
||||
style: GoogleFonts.kanit(
|
||||
color: Color(0xff565656),
|
||||
fontSize: 15,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Container(
|
||||
child: TextField(
|
||||
keyboardType: TextInputType.emailAddress,
|
||||
// inputFormatters: [
|
||||
// FilteringTextInputFormatter.allow(RegExp(r'[0-9]')),
|
||||
// ],
|
||||
controller: _current_email,
|
||||
decoration: InputDecoration(
|
||||
// hintText: 'อีเมลปัจจุบัน'.tr(),
|
||||
border: InputBorder.none,
|
||||
contentPadding: EdgeInsets.symmetric(horizontal: 16),
|
||||
),
|
||||
),
|
||||
// margin: EdgeInsets.symmetric(horizontal: 20),
|
||||
height: 48,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
color: Color(0xfff2f2f2),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Text(
|
||||
"อีเมลใหม่".tr(),
|
||||
style: GoogleFonts.kanit(
|
||||
color: Color(0xff565656),
|
||||
fontSize: 15,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Container(
|
||||
child: TextField(
|
||||
keyboardType: TextInputType.emailAddress,
|
||||
// inputFormatters: [
|
||||
// FilteringTextInputFormatter.allow(RegExp(r'[0-9]')),
|
||||
// ],
|
||||
controller: _new_email,
|
||||
decoration: InputDecoration(
|
||||
// hintText: 'อีเมลปัจจุบัน'.tr(),
|
||||
border: InputBorder.none,
|
||||
contentPadding: EdgeInsets.symmetric(horizontal: 16),
|
||||
),
|
||||
),
|
||||
// margin: EdgeInsets.symmetric(horizontal: 20),
|
||||
height: 48,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
color: Color(0xfff2f2f2),
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
// Expanded(child: Container()),
|
||||
InkWell(
|
||||
onTap: () async {
|
||||
// initPromptPay(context);
|
||||
},
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
child: Card(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(40),
|
||||
),
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
child: Text(
|
||||
"Confirm".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: GoogleFonts.kanit(
|
||||
color: ColorCustom.greyBorder,
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
]),
|
||||
))));
|
||||
}
|
||||
}
|
||||
@@ -24,6 +24,7 @@ import '../model/promotion_model.dart';
|
||||
import '../model/token_model.dart';
|
||||
import '../utils/color_custom.dart';
|
||||
import '../utils/utils.dart';
|
||||
import 'Setting.dart';
|
||||
|
||||
Profile? profile;
|
||||
String tokenAdmin = "";
|
||||
@@ -226,16 +227,9 @@ class _HomePageState extends State<HomePage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return PopScope(
|
||||
canPop: _canPop, // <== set a bool var or set it to false
|
||||
onPopInvoked: (bool didPop) async {
|
||||
if (didPop) {
|
||||
return;
|
||||
}
|
||||
if (Navigator.of(context).canPop()) {
|
||||
Navigator.of(context).pop(context);
|
||||
}
|
||||
},
|
||||
child: Scaffold(
|
||||
canPop: false,
|
||||
|
||||
child: Scaffold(
|
||||
body: SafeArea(
|
||||
child: SmartRefresher(
|
||||
onRefresh: () {
|
||||
@@ -265,6 +259,23 @@ class _HomePageState extends State<HomePage> {
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () {
|
||||
showModalBottomSheet<void>(
|
||||
context: context,
|
||||
isScrollControlled: true,
|
||||
useSafeArea: true,
|
||||
builder: (BuildContext context) {
|
||||
return SettingPage();
|
||||
});
|
||||
// clearProfile();
|
||||
},
|
||||
child: Icon(
|
||||
Icons.settings,
|
||||
size: 20,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
|
||||
|
||||
179
neowallet_mobile/lib/Home/Setting.dart
Normal file
179
neowallet_mobile/lib/Home/Setting.dart
Normal file
@@ -0,0 +1,179 @@
|
||||
import 'package:cathaypay_mobile/Pay/QrScanDialog.dart';
|
||||
import 'package:cathaypay_mobile/Pay/ThaiQrDialog.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
|
||||
import '../Home/home_bottom_menu_widget.dart';
|
||||
import '../Pay/PayPromptPay.dart';
|
||||
import '../TransferMoney/TransferPromptPay.dart';
|
||||
import '../TransferMoney/transfer_history.dart';
|
||||
import 'ChangeEmail.dart';
|
||||
|
||||
class SettingPage extends StatefulWidget {
|
||||
const SettingPage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<SettingPage> createState() => _SettingPageState();
|
||||
}
|
||||
|
||||
class _SettingPageState extends State<SettingPage> {
|
||||
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
// {
|
||||
// "MobileDeviceNo": "string", "TransactionID": "string", "Amount": 0,
|
||||
// "Note": "string"
|
||||
// }
|
||||
|
||||
var isReturn = false;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor: Colors.transparent,
|
||||
flexibleSpace: Image(
|
||||
image: AssetImage('images/home/Head.png'),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
leading: CupertinoButton(
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: const Icon(
|
||||
Icons.chevron_left,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
elevation: 0,
|
||||
title: Text(
|
||||
"ตั้งค่า".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: GoogleFonts.kanit(
|
||||
color: Colors.white,
|
||||
fontSize: 20,
|
||||
),
|
||||
),
|
||||
),
|
||||
body: Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
child: Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20),
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
// Navigator.popUntil(context, ModalRoute.withName('/'));
|
||||
// Navigator.pushNamed(context, '/HomePage');
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => ChangeEmailPage(),
|
||||
),
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
height: 48,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Color(0x26000000),
|
||||
blurRadius: 2,
|
||||
offset: Offset(0.75, 1.50),
|
||||
),
|
||||
],
|
||||
color: Color(0xfffbfbfb),
|
||||
),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 20,
|
||||
),
|
||||
Text(
|
||||
"เปลี่ยนอีเมล".tr(),
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
showModalBottomSheet<void>(
|
||||
context: context,
|
||||
isScrollControlled: true,
|
||||
useSafeArea: true,
|
||||
builder: (BuildContext context) {
|
||||
return ThaiQrDialog();
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
height: 48,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Color(0x26000000),
|
||||
blurRadius: 2,
|
||||
offset: Offset(0.75, 1.50),
|
||||
),
|
||||
],
|
||||
color: Color(0xfffbfbfb),
|
||||
),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 20,
|
||||
),
|
||||
Text(
|
||||
"เปลี่ยนรหัสผ่าน".tr(),
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
],
|
||||
),
|
||||
),
|
||||
Expanded(child: Container()),
|
||||
HomeBottomMenuWidget()
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
/*
|
||||
import 'package:cathaypay_mobile/Home/HomePage.dart';
|
||||
import 'package:cathaypay_mobile/utils/utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -31,6 +32,8 @@ class _PayQrDialogState extends State<PayQrDialog> {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
@@ -280,3 +283,157 @@ class _PayQrDialogState extends State<PayQrDialog> {
|
||||
);
|
||||
}
|
||||
}
|
||||
*/
|
||||
import 'dart:io';
|
||||
import 'dart:typed_data';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
import 'package:saver_gallery/saver_gallery.dart';
|
||||
import 'package:screenshot/screenshot.dart';
|
||||
|
||||
import '../utils/utils.dart';
|
||||
|
||||
class PayQrDialog extends StatefulWidget {
|
||||
const PayQrDialog({
|
||||
Key? key,
|
||||
required this.name,
|
||||
required this.phone,
|
||||
required this.transactionId,
|
||||
required this.price,
|
||||
}) : super(key: key);
|
||||
|
||||
final String name;
|
||||
final String phone;
|
||||
final String transactionId;
|
||||
final String price;
|
||||
|
||||
@override
|
||||
State<PayQrDialog> createState() => _PayQrDialogState();
|
||||
}
|
||||
|
||||
class _PayQrDialogState extends State<PayQrDialog> {
|
||||
|
||||
ScreenshotController screenshotController = ScreenshotController();
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Screenshot(
|
||||
controller: screenshotController,
|
||||
child:Padding(
|
||||
padding: const EdgeInsets.all(20.0),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Card(
|
||||
color: const Color(0xfffbfbfb),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(10.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
height: 180,
|
||||
width: 180,
|
||||
child: const Image(
|
||||
image: AssetImage('images/neopay_logo.png'),
|
||||
),
|
||||
),
|
||||
const Text(
|
||||
"Approved or completed successfully",
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w300,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Text(
|
||||
"Amount ฿${widget.price}",
|
||||
style: const TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w300,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Text(
|
||||
"Receiver:",
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w300,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
widget.name,
|
||||
style: const TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
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,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
],
|
||||
),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -548,6 +548,14 @@ class _TopUpHistoryState extends State<TopUpHistory> {
|
||||
fontWeight: FontWeight.w300,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
Utils.convertDateToTime("Trans.ID. ${transactions.ePaymentTransactionID}" ?? ""),
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w300,
|
||||
),
|
||||
),
|
||||
// Row(
|
||||
// children: [
|
||||
// Spacer(),
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
import 'dart:math';
|
||||
|
||||
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 '../utils/utils.dart';
|
||||
|
||||
class TransferCathayPayDialog extends StatefulWidget {
|
||||
const TransferCathayPayDialog({Key? key}) : super(key: key);
|
||||
@@ -9,9 +15,12 @@ class TransferCathayPayDialog extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _TransferCathayPayDialogState extends State<TransferCathayPayDialog> {
|
||||
ScreenshotController screenshotController = ScreenshotController();
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
return Screenshot(
|
||||
controller: screenshotController,
|
||||
child:Padding(
|
||||
padding: const EdgeInsets.only(left: 20,right: 20),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
@@ -279,6 +288,55 @@ 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,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -288,6 +346,6 @@ class _TransferCathayPayDialogState extends State<TransferCathayPayDialog> {
|
||||
),
|
||||
|
||||
]),
|
||||
);
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
import 'dart:io';
|
||||
import 'dart:math';
|
||||
import 'dart:typed_data';
|
||||
|
||||
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 'package:saver_gallery/saver_gallery.dart';
|
||||
import 'package:screenshot/screenshot.dart';
|
||||
|
||||
import '../api/api.dart';
|
||||
import '../model/profile_model.dart';
|
||||
@@ -19,237 +26,320 @@ class TransferPromtptPayDialog extends StatefulWidget {
|
||||
|
||||
class _TransferPromtptPayDialogState extends State<TransferPromtptPayDialog> {
|
||||
@override
|
||||
ScreenshotController screenshotController = ScreenshotController();
|
||||
|
||||
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 {}
|
||||
});
|
||||
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.fromLTRB(20, 0, 20, 0),
|
||||
child: Column(mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [
|
||||
Card(
|
||||
color: Color(0xfffbfbfb),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(15.0),
|
||||
child: Column(
|
||||
return Screenshot(
|
||||
controller: screenshotController,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.fromLTRB(20, 0, 20, 0),
|
||||
child: Column(mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
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,
|
||||
),
|
||||
) ,
|
||||
SizedBox(height: 30,),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage('images/neo_backgroup.png'),
|
||||
fit: BoxFit.fill,
|
||||
|
||||
),
|
||||
),
|
||||
child:Column(children: [ Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
"Date Time / วันที่ เวลา",
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w300,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
Utils.getDateTimeCreate(),
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
"Receiver / ผู้รับเงิน",
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w300,
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
|
||||
Text(//profile?.fullName??"",
|
||||
widget.name,
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
"PhoneNumber / Wallet ID",
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w300,
|
||||
),
|
||||
),
|
||||
Text(widget.phone,
|
||||
//profile?.phoneNumber ?? "",
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
"From",
|
||||
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(
|
||||
"PhoneNumber / 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,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 35,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
"Transaction ID : ",
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w300,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Container(
|
||||
child: Text(
|
||||
widget.bill,
|
||||
Card(
|
||||
color: Color(0xfffbfbfb),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(15.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: 12,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w300,
|
||||
),
|
||||
textAlign: TextAlign.start,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),],)
|
||||
),
|
||||
|
||||
SizedBox(height: 15,),
|
||||
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Navigator.popUntil(context, ModalRoute.withName('/HomePage'));
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(bottom: 15),
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: 46,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
color: Color(0xffad022c),
|
||||
),
|
||||
child: Center(
|
||||
child: Text(
|
||||
"ปิด",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w300,
|
||||
Text(
|
||||
"ดำเนินการโอน/จ่ายสำเร็จ",
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w300,
|
||||
),
|
||||
),
|
||||
)),
|
||||
))
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
]));
|
||||
|
||||
Text(
|
||||
"จำนวนเงิน/Amount ฿" + widget.price,
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w300,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 30,),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage('images/neo_backgroup.png'),
|
||||
fit: BoxFit.fill,
|
||||
|
||||
),
|
||||
),
|
||||
child: Column(children: [ Row(
|
||||
mainAxisAlignment: MainAxisAlignment
|
||||
.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
"Date Time / วันที่ เวลา",
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w300,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
Utils.getDateTimeCreate(),
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
"Receiver / ผู้รับเงิน",
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w300,
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
|
||||
Text( //profile?.fullName??"",
|
||||
widget.name,
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment
|
||||
.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
"PhoneNumber / Wallet ID",
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w300,
|
||||
),
|
||||
),
|
||||
Text(widget.phone,
|
||||
//profile?.phoneNumber ?? "",
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment
|
||||
.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
"From",
|
||||
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(
|
||||
"PhoneNumber / 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,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 35,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment
|
||||
.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
"Transaction ID : ",
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w300,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Container(
|
||||
child: Text(
|
||||
widget.bill,
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w300,
|
||||
),
|
||||
textAlign: TextAlign.start,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
],)
|
||||
),
|
||||
|
||||
SizedBox(height: 15,),
|
||||
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Navigator.popUntil(
|
||||
context, ModalRoute.withName('/HomePage'));
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(bottom: 15),
|
||||
width: MediaQuery
|
||||
.of(context)
|
||||
.size
|
||||
.width,
|
||||
height: 46,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
color: Color(0xffad022c),
|
||||
),
|
||||
child: Center(
|
||||
child: Text(
|
||||
"ปิด",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w300,
|
||||
),
|
||||
)),
|
||||
)),
|
||||
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,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
])));
|
||||
}
|
||||
}
|
||||
|
||||
Future<dynamic> ShowCapturedWidget(BuildContext context,
|
||||
Uint8List capturedImage) {
|
||||
return showDialog(
|
||||
useSafeArea: false,
|
||||
context: context,
|
||||
builder: (context) =>
|
||||
Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text("Captured widget screenshot"),
|
||||
),
|
||||
body: Center(child: Image.memory(capturedImage as Uint8List)),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -137,6 +137,13 @@ class _TopUpHistoryState extends State<TransferHistory> {
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"To ${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 ?? "",
|
||||
style: TextStyle(
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:saver_gallery/saver_gallery.dart';
|
||||
import 'package:screenshot/screenshot.dart';
|
||||
|
||||
import '../utils/utils.dart';
|
||||
|
||||
class WithDrawDialog extends StatefulWidget {
|
||||
|
||||
@@ -12,11 +16,14 @@ class WithDrawDialog extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _WithDrawDialogState extends State<WithDrawDialog> {
|
||||
ScreenshotController screenshotController = ScreenshotController();
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
return AlertDialog(
|
||||
title: Container(
|
||||
title: Screenshot(
|
||||
controller: screenshotController,
|
||||
child:Container(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(0.0),
|
||||
child: Column(
|
||||
@@ -186,6 +193,55 @@ class _WithDrawDialogState extends State<WithDrawDialog> {
|
||||
),
|
||||
),
|
||||
),
|
||||
]))));
|
||||
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,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
])))));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@ class Api {
|
||||
static String qrCodeTransferConfirm = BaseUrlBuilding + "api/v2/Payment/transaction/ConfirmTransferedQR";
|
||||
static String initC2B = BaseUrlBuilding + "api/v2/Payment/transaction/initialB2C";
|
||||
static String getTransactionTopUp = BaseUrlBuilding + "api/v2/EPaymentSCB/GetEPaymentRequestCriteria";
|
||||
static String getTransactionTopUpV4 = BaseUrlBuilding + "api/v4/EPaymentReport/GetModelLogCriteria";
|
||||
static String ekyc = BaseUrlCathay + "common/kyc";
|
||||
static String uploadImage = BaseUrlCathay + "common/upload";
|
||||
static String walletTopup = BaseUrlBuilding + "api/V2/EPaymentSCB/WalletTopup";
|
||||
@@ -61,6 +62,7 @@ class Api {
|
||||
static String c2bConfirm = BaseUrlBuilding + "api/v2/Payment/transaction/confirmC2B";
|
||||
//static String getTransaction = BaseUrlBuilding + "api/v2/Payment/getTransaction";
|
||||
static String getTransaction = BaseUrlBuilding + "api/v2/EPaymentReport/GetModelLogCriteria";
|
||||
static String getTransactionV4 = BaseUrlBuilding + "api/v4/EPaymentReport/GetModelLogCriteria";
|
||||
// static String BaseUrlBuildingCathay = "https://sathorn.cathay-pay.com/";
|
||||
static String payPromptPayInitial = BaseUrlBuilding + "api/v4/EPaymentBBL/TransferedPromptPayIDInitial";
|
||||
static String payPromptPayConfirm = BaseUrlBuilding + "api/v4/EPaymentBBL/TransferedPromptPayIDConfirm";
|
||||
|
||||
@@ -86,3 +86,117 @@ class Transactions {
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class TransactionsV4 {
|
||||
String? id;
|
||||
String? phoneNumber;
|
||||
String? payeeUserAccountId;
|
||||
String? payeeName;
|
||||
String? payerUserAccountId;
|
||||
String? payerName;
|
||||
dynamic? invoiceId;
|
||||
dynamic? referencE1;
|
||||
dynamic? referencE2;
|
||||
dynamic? referencE3;
|
||||
String? paymentStatus;
|
||||
String? paymentChannel;
|
||||
String? qrId;
|
||||
String? createDate;
|
||||
String? updateDate;
|
||||
String? sattleDate;
|
||||
String? voidDate;
|
||||
String? refundDate;
|
||||
String? cancelDate;
|
||||
double? amount;
|
||||
String? createBy;
|
||||
String? createByName;
|
||||
String? updateBy;
|
||||
String? updateByName;
|
||||
String? note;
|
||||
|
||||
TransactionsV4(
|
||||
{this.id,
|
||||
this.phoneNumber,
|
||||
this.payeeUserAccountId,
|
||||
this.payeeName,
|
||||
this.payerUserAccountId,
|
||||
this.payerName,
|
||||
this.invoiceId,
|
||||
this.referencE1,
|
||||
this.referencE2,
|
||||
this.referencE3,
|
||||
this.paymentStatus,
|
||||
this.paymentChannel,
|
||||
this.qrId,
|
||||
this.createDate,
|
||||
this.updateDate,
|
||||
this.sattleDate,
|
||||
this.voidDate,
|
||||
this.refundDate,
|
||||
this.cancelDate,
|
||||
this.amount,
|
||||
this.createBy,
|
||||
this.createByName,
|
||||
this.updateBy,
|
||||
this.updateByName,
|
||||
this.note});
|
||||
|
||||
TransactionsV4.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
phoneNumber = json['phoneNumber'];
|
||||
payeeUserAccountId = json['payeeUserAccountId'];
|
||||
payeeName = json['payeeName'];
|
||||
payerUserAccountId = json['payerUserAccountId'];
|
||||
payerName = json['payerName'];
|
||||
invoiceId = json['invoiceId'];
|
||||
referencE1 = json['referencE1'];
|
||||
referencE2 = json['referencE2'];
|
||||
referencE3 = json['referencE3'];
|
||||
paymentStatus = json['paymentStatus'];
|
||||
paymentChannel = json['paymentChannel'];
|
||||
qrId = json['qrId'];
|
||||
createDate = json['createDate'];
|
||||
updateDate = json['updateDate'];
|
||||
sattleDate = json['sattleDate'];
|
||||
voidDate = json['voidDate'];
|
||||
refundDate = json['refundDate'];
|
||||
cancelDate = json['cancelDate'];
|
||||
amount = json['amount'];
|
||||
createBy = json['createBy'];
|
||||
createByName = json['createByName'];
|
||||
updateBy = json['updateBy'];
|
||||
updateByName = json['updateByName'];
|
||||
note = json['note'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['id'] = this.id;
|
||||
data['phoneNumber'] = this.phoneNumber;
|
||||
data['payeeUserAccountId'] = this.payeeUserAccountId;
|
||||
data['payeeName'] = this.payeeName;
|
||||
data['payerUserAccountId'] = this.payerUserAccountId;
|
||||
data['payerName'] = this.payerName;
|
||||
data['invoiceId'] = this.invoiceId;
|
||||
data['referencE1'] = this.referencE1;
|
||||
data['referencE2'] = this.referencE2;
|
||||
data['referencE3'] = this.referencE3;
|
||||
data['paymentStatus'] = this.paymentStatus;
|
||||
data['paymentChannel'] = this.paymentChannel;
|
||||
data['qrId'] = this.qrId;
|
||||
data['createDate'] = this.createDate;
|
||||
data['updateDate'] = this.updateDate;
|
||||
data['sattleDate'] = this.sattleDate;
|
||||
data['voidDate'] = this.voidDate;
|
||||
data['refundDate'] = this.refundDate;
|
||||
data['cancelDate'] = this.cancelDate;
|
||||
data['amount'] = this.amount;
|
||||
data['createBy'] = this.createBy;
|
||||
data['createByName'] = this.createByName;
|
||||
data['updateBy'] = this.updateBy;
|
||||
data['updateByName'] = this.updateByName;
|
||||
data['note'] = this.note;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user