update
@@ -6,7 +6,7 @@ buildscript {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:7.2.0'
|
classpath 'com.android.tools.build:gradle:7.3.0'
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
|
#Thu Nov 21 13:48:17 ICT 2024
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"Welcome":"Welcome",
|
"Welcome":"Welcome",
|
||||||
"to CATHAY PAY":"to CATHAY PAY",
|
"to CATHAY PAY":"to NEO PAY",
|
||||||
"Log In":"Log In",
|
"Log In":"Log In",
|
||||||
"Register":"Register",
|
"Register":"Register",
|
||||||
"Username":"Username",
|
"Username":"Username",
|
||||||
@@ -116,6 +116,21 @@
|
|||||||
"Email ไม่ถูกต้อง":"Email is invalid",
|
"Email ไม่ถูกต้อง":"Email is invalid",
|
||||||
"หน้าหลัก":"Home",
|
"หน้าหลัก":"Home",
|
||||||
"สแกน":"Scan",
|
"สแกน":"Scan",
|
||||||
"ทั้งหมด":"All"
|
"ทั้งหมด":"All",
|
||||||
|
"สแกน QR Code NEO PAY":"Scan QR Code NEO PAY",
|
||||||
|
"สแกน Thai QR Code":"Scan Thai QR Code",
|
||||||
|
"แอปพลิเคชันทั้งหมด":"All Application",
|
||||||
|
"สมาชิก NEO PAY":"Neo Wallet",
|
||||||
|
"บัญชีธนาคาร":"Bank Account",
|
||||||
|
"โอนเงินให้สมาชิก NEO PAY":"Transfer to NEO WALLET",
|
||||||
|
"เบอร์โทรศัพท์ผู้รับ":"Mobile Phone Number/ Wallet ID",
|
||||||
|
"ชื่อ":"Receiver Name",
|
||||||
|
"เบอร์โทรศัพท์":"Phone Number",
|
||||||
|
"จำนวนเงินที่โอน / จ่าย":"Amount",
|
||||||
|
"ใช้แต้ม NEO PAY แทนเงินสด":"Pay by Point",
|
||||||
|
"คะแนนของคุณ":"Your Point",
|
||||||
|
"แต้ม":"Point",
|
||||||
|
"ยอดเงินทั้งหมด":"Total Amount",
|
||||||
|
"1 แต้ม = 10 สตางค์":"1 Point = 10 Satang"
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"Welcome":"ยินดีต้อนรับ",
|
"Welcome":"ยินดีต้อนรับ",
|
||||||
"to CATHAY PAY":"สู่ CATHAY PAY",
|
"to CATHAY PAY":"สู่ NEO PAY",
|
||||||
"Log In":"เข้าสู่ระบบ",
|
"Log In":"เข้าสู่ระบบ",
|
||||||
"Register":"สมัครสมาชิก",
|
"Register":"สมัครสมาชิก",
|
||||||
"Username":"ผู้ใช้งาน",
|
"Username":"ผู้ใช้งาน",
|
||||||
@@ -116,8 +116,22 @@
|
|||||||
"Email ไม่ถูกต้อง":"Email ไม่ถูกต้อง",
|
"Email ไม่ถูกต้อง":"Email ไม่ถูกต้อง",
|
||||||
"หน้าหลัก":"หน้าหลัก",
|
"หน้าหลัก":"หน้าหลัก",
|
||||||
"สแกน":"สแกน",
|
"สแกน":"สแกน",
|
||||||
"ทั้งหมด":"ทั้งหมด"
|
"ทั้งหมด":"ทั้งหมด",
|
||||||
|
"สแกน QR Code NEO PAY":"สแกน QR Code NEO PAY",
|
||||||
|
"สแกน Thai QR Code":"สแกน Thai QR Code",
|
||||||
|
"แอปพลิเคชันทั้งหมด":"แอปพลิเคชันทั้งหมด",
|
||||||
|
"สมาชิก NEO PAY":"สมาชิก NEO PAY",
|
||||||
|
"บัญชีธนาคาร":"บัญชีธนาคาร",
|
||||||
|
"โอนเงินให้สมาชิก NEO PAY":"โอนเงินให้สมาชิก NEO PAY",
|
||||||
|
"เบอร์โทรศัพท์ผู้รับ":"เบอร์โทรศัพท์ผู้รับ",
|
||||||
|
"ชื่อ":"ชื่อ",
|
||||||
|
"เบอร์โทรศัพท์":"เบอร์โทรศัพท์",
|
||||||
|
"จำนวนเงินที่โอน / จ่าย":"จำนวนเงินที่โอน / จ่าย",
|
||||||
|
"ใช้แต้ม NEO PAY แทนเงินสด":"ใช้แต้ม NEO PAY แทนเงินสด",
|
||||||
|
"คะแนนของคุณ":"คะแนนของคุณ",
|
||||||
|
"แต้ม":"แต้ม",
|
||||||
|
"ยอดเงินทั้งหมด":"ยอดเงินทั้งหมด",
|
||||||
|
"1 แต้ม = 10 สตางค์":"1 แต้ม = 10 สตางค์"
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
BIN
neowallet_mobile/images/home/15.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
neowallet_mobile/images/home/17.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
neowallet_mobile/images/home/19.png
Normal file
|
After Width: | Height: | Size: 9.1 KiB |
BIN
neowallet_mobile/images/menu/22.png
Normal file
|
After Width: | Height: | Size: 27 KiB |
BIN
neowallet_mobile/images/menu/23.png
Normal file
|
After Width: | Height: | Size: 70 KiB |
BIN
neowallet_mobile/images/menu/24.png
Normal file
|
After Width: | Height: | Size: 72 KiB |
BIN
neowallet_mobile/images/menu/25.png
Normal file
|
After Width: | Height: | Size: 72 KiB |
BIN
neowallet_mobile/images/menu/26.png
Normal file
|
After Width: | Height: | Size: 65 KiB |
BIN
neowallet_mobile/images/menu/27.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
neowallet_mobile/images/menu/31.png
Normal file
|
After Width: | Height: | Size: 61 KiB |
BIN
neowallet_mobile/images/menu/32.png
Normal file
|
After Width: | Height: | Size: 65 KiB |
BIN
neowallet_mobile/images/register/passport_en.png
Normal file
|
After Width: | Height: | Size: 60 KiB |
BIN
neowallet_mobile/images/register/passport_th.png
Normal file
|
After Width: | Height: | Size: 61 KiB |
BIN
neowallet_mobile/images/register/thaicard_en.png
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
neowallet_mobile/images/register/thaicard_th.png
Normal file
|
After Width: | Height: | Size: 34 KiB |
@@ -4,8 +4,6 @@ PODS:
|
|||||||
- device_info_plus (0.0.1):
|
- device_info_plus (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
- Flutter (1.0.0)
|
- Flutter (1.0.0)
|
||||||
- image_gallery_saver (2.0.2):
|
|
||||||
- Flutter
|
|
||||||
- image_picker_ios (0.0.1):
|
- image_picker_ios (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
- MTBBarcodeScanner (5.0.11)
|
- MTBBarcodeScanner (5.0.11)
|
||||||
@@ -14,9 +12,13 @@ PODS:
|
|||||||
- path_provider_foundation (0.0.1):
|
- path_provider_foundation (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
- FlutterMacOS
|
- FlutterMacOS
|
||||||
|
- permission_handler_apple (9.3.0):
|
||||||
|
- Flutter
|
||||||
- qr_code_scanner (0.2.0):
|
- qr_code_scanner (0.2.0):
|
||||||
- Flutter
|
- Flutter
|
||||||
- MTBBarcodeScanner
|
- MTBBarcodeScanner
|
||||||
|
- saver_gallery (0.0.1):
|
||||||
|
- Flutter
|
||||||
- shared_preferences_foundation (0.0.1):
|
- shared_preferences_foundation (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
- FlutterMacOS
|
- FlutterMacOS
|
||||||
@@ -29,11 +31,12 @@ DEPENDENCIES:
|
|||||||
- camera_avfoundation (from `.symlinks/plugins/camera_avfoundation/ios`)
|
- camera_avfoundation (from `.symlinks/plugins/camera_avfoundation/ios`)
|
||||||
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
|
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
|
||||||
- Flutter (from `Flutter`)
|
- Flutter (from `Flutter`)
|
||||||
- image_gallery_saver (from `.symlinks/plugins/image_gallery_saver/ios`)
|
|
||||||
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
|
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
|
||||||
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
|
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
|
||||||
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
|
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
|
||||||
|
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
|
||||||
- qr_code_scanner (from `.symlinks/plugins/qr_code_scanner/ios`)
|
- qr_code_scanner (from `.symlinks/plugins/qr_code_scanner/ios`)
|
||||||
|
- saver_gallery (from `.symlinks/plugins/saver_gallery/ios`)
|
||||||
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
|
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
|
||||||
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
|
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
|
||||||
- webview_flutter_wkwebview (from `.symlinks/plugins/webview_flutter_wkwebview/ios`)
|
- webview_flutter_wkwebview (from `.symlinks/plugins/webview_flutter_wkwebview/ios`)
|
||||||
@@ -49,16 +52,18 @@ EXTERNAL SOURCES:
|
|||||||
:path: ".symlinks/plugins/device_info_plus/ios"
|
:path: ".symlinks/plugins/device_info_plus/ios"
|
||||||
Flutter:
|
Flutter:
|
||||||
:path: Flutter
|
:path: Flutter
|
||||||
image_gallery_saver:
|
|
||||||
:path: ".symlinks/plugins/image_gallery_saver/ios"
|
|
||||||
image_picker_ios:
|
image_picker_ios:
|
||||||
:path: ".symlinks/plugins/image_picker_ios/ios"
|
:path: ".symlinks/plugins/image_picker_ios/ios"
|
||||||
package_info_plus:
|
package_info_plus:
|
||||||
:path: ".symlinks/plugins/package_info_plus/ios"
|
:path: ".symlinks/plugins/package_info_plus/ios"
|
||||||
path_provider_foundation:
|
path_provider_foundation:
|
||||||
:path: ".symlinks/plugins/path_provider_foundation/darwin"
|
:path: ".symlinks/plugins/path_provider_foundation/darwin"
|
||||||
|
permission_handler_apple:
|
||||||
|
:path: ".symlinks/plugins/permission_handler_apple/ios"
|
||||||
qr_code_scanner:
|
qr_code_scanner:
|
||||||
:path: ".symlinks/plugins/qr_code_scanner/ios"
|
:path: ".symlinks/plugins/qr_code_scanner/ios"
|
||||||
|
saver_gallery:
|
||||||
|
:path: ".symlinks/plugins/saver_gallery/ios"
|
||||||
shared_preferences_foundation:
|
shared_preferences_foundation:
|
||||||
:path: ".symlinks/plugins/shared_preferences_foundation/darwin"
|
:path: ".symlinks/plugins/shared_preferences_foundation/darwin"
|
||||||
url_launcher_ios:
|
url_launcher_ios:
|
||||||
@@ -70,16 +75,17 @@ SPEC CHECKSUMS:
|
|||||||
camera_avfoundation: dd002b0330f4981e1bbcb46ae9b62829237459a4
|
camera_avfoundation: dd002b0330f4981e1bbcb46ae9b62829237459a4
|
||||||
device_info_plus: c6fb39579d0f423935b0c9ce7ee2f44b71b9fce6
|
device_info_plus: c6fb39579d0f423935b0c9ce7ee2f44b71b9fce6
|
||||||
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
|
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
|
||||||
image_gallery_saver: cb43cc43141711190510e92c460eb1655cd343cb
|
|
||||||
image_picker_ios: c560581cceedb403a6ff17f2f816d7fea1421fc1
|
image_picker_ios: c560581cceedb403a6ff17f2f816d7fea1421fc1
|
||||||
MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb
|
MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb
|
||||||
package_info_plus: 58f0028419748fad15bf008b270aaa8e54380b1c
|
package_info_plus: 58f0028419748fad15bf008b270aaa8e54380b1c
|
||||||
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
|
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
|
||||||
|
permission_handler_apple: 9878588469a2b0d0fc1e048d9f43605f92e6cec2
|
||||||
qr_code_scanner: bb67d64904c3b9658ada8c402e8b4d406d5d796e
|
qr_code_scanner: bb67d64904c3b9658ada8c402e8b4d406d5d796e
|
||||||
|
saver_gallery: 76172dc4bf6b40e66d694948ada9ff402304dd87
|
||||||
shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
|
shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
|
||||||
url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe
|
url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe
|
||||||
webview_flutter_wkwebview: 2a23822e9039b7b1bc52e5add778e5d89ad488d1
|
webview_flutter_wkwebview: 2a23822e9039b7b1bc52e5add778e5d89ad488d1
|
||||||
|
|
||||||
PODFILE CHECKSUM: 57c8aed26fba39d3ec9424816221f294a07c58eb
|
PODFILE CHECKSUM: 57c8aed26fba39d3ec9424816221f294a07c58eb
|
||||||
|
|
||||||
COCOAPODS: 1.15.2
|
COCOAPODS: 1.16.2
|
||||||
|
|||||||
@@ -141,6 +141,7 @@
|
|||||||
9705A1C41CF9048500538489 /* Embed Frameworks */,
|
9705A1C41CF9048500538489 /* Embed Frameworks */,
|
||||||
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
|
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
|
||||||
1A038E6A347A908126F4CAA5 /* [CP] Embed Pods Frameworks */,
|
1A038E6A347A908126F4CAA5 /* [CP] Embed Pods Frameworks */,
|
||||||
|
AE4B7B02856EC8235D5750DA /* [CP] Copy Pods Resources */,
|
||||||
);
|
);
|
||||||
buildRules = (
|
buildRules = (
|
||||||
);
|
);
|
||||||
@@ -269,6 +270,23 @@
|
|||||||
shellPath = /bin/sh;
|
shellPath = /bin/sh;
|
||||||
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
|
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
|
||||||
};
|
};
|
||||||
|
AE4B7B02856EC8235D5750DA /* [CP] Copy Pods Resources */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
inputFileListPaths = (
|
||||||
|
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist",
|
||||||
|
);
|
||||||
|
name = "[CP] Copy Pods Resources";
|
||||||
|
outputFileListPaths = (
|
||||||
|
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist",
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
|
||||||
|
showEnvVarsInLog = 0;
|
||||||
|
};
|
||||||
/* End PBXShellScriptBuildPhase section */
|
/* End PBXShellScriptBuildPhase section */
|
||||||
|
|
||||||
/* Begin PBXSourcesBuildPhase section */
|
/* Begin PBXSourcesBuildPhase section */
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import UIKit
|
import UIKit
|
||||||
import Flutter
|
import Flutter
|
||||||
|
|
||||||
@UIApplicationMain
|
@main
|
||||||
@objc class AppDelegate: FlutterAppDelegate {
|
@objc class AppDelegate: FlutterAppDelegate {
|
||||||
override func application(
|
override func application(
|
||||||
_ application: UIApplication,
|
_ application: UIApplication,
|
||||||
|
|||||||
@@ -19,11 +19,11 @@
|
|||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>1.0.0</string>
|
<string>1.0.1</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>2</string>
|
<string>3</string>
|
||||||
<key>LSApplicationCategoryType</key>
|
<key>LSApplicationCategoryType</key>
|
||||||
<string></string>
|
<string></string>
|
||||||
<key>LSRequiresIPhoneOS</key>
|
<key>LSRequiresIPhoneOS</key>
|
||||||
|
|||||||
@@ -8,11 +8,13 @@ import 'package:easy_localization/easy_localization.dart';
|
|||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:image_gallery_saver/image_gallery_saver.dart';
|
|
||||||
import 'package:qr_flutter/qr_flutter.dart';
|
import 'package:qr_flutter/qr_flutter.dart';
|
||||||
|
import 'package:saver_gallery/saver_gallery.dart';
|
||||||
|
|
||||||
import '../Home/HomePage.dart';
|
import '../Home/HomePage.dart';
|
||||||
|
import '../Home/home_bottom_menu_widget.dart';
|
||||||
import '../api/api.dart';
|
import '../api/api.dart';
|
||||||
|
import '../utils/color_custom.dart';
|
||||||
import '../utils/utils.dart';
|
import '../utils/utils.dart';
|
||||||
|
|
||||||
class GetPaidPage extends StatefulWidget {
|
class GetPaidPage extends StatefulWidget {
|
||||||
@@ -47,7 +49,9 @@ class _GetPaidPageState extends State<GetPaidPage> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
saveQrCode() {
|
saveQrCode() {
|
||||||
ImageGallerySaver.saveImage(base64Decode(myQrCode?.qrCodeImage ?? ""));
|
// ImageGallerySaver.saveImage(base64Decode(myQrCode?.qrCodeImage ?? ""));
|
||||||
|
String fileName = "neopay_${DateTime.now().millisecondsSinceEpoch}.jpg";
|
||||||
|
SaverGallery.saveImage(base64Decode(myQrCode?.qrCodeImage ?? ""), fileName: fileName, skipIfExists: false);
|
||||||
Utils.showAlertDialog(context, "บันทึกสำเร็จ");
|
Utils.showAlertDialog(context, "บันทึกสำเร็จ");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -255,27 +259,23 @@ class _GetPaidPageState extends State<GetPaidPage> {
|
|||||||
onTap: () {
|
onTap: () {
|
||||||
saveQrCode();
|
saveQrCode();
|
||||||
},
|
},
|
||||||
child: Container(
|
child: SizedBox(
|
||||||
width: 147,
|
width: 147,
|
||||||
height: 44,
|
child: Card(
|
||||||
decoration: BoxDecoration(
|
color: Colors.white,
|
||||||
borderRadius: BorderRadius.circular(100),
|
shape: RoundedRectangleBorder(
|
||||||
boxShadow: [
|
borderRadius: BorderRadius.circular(40),
|
||||||
BoxShadow(
|
),
|
||||||
color: Color(0x19000000),
|
child: Container(
|
||||||
blurRadius: 2,
|
padding: EdgeInsets.all(10),
|
||||||
offset: Offset(0.75, 1),
|
child: Text(
|
||||||
),
|
"Save QR".tr(),
|
||||||
],
|
textAlign: TextAlign.center,
|
||||||
color: Color(0xff9d001b),
|
style: GoogleFonts.kanit(
|
||||||
),
|
color: ColorCustom.greyBorder,
|
||||||
child: Center(
|
fontSize: 20,
|
||||||
child: Text(
|
fontWeight: FontWeight.w500,
|
||||||
"Save QR".tr(),
|
),
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: TextStyle(
|
|
||||||
color: Colors.white,
|
|
||||||
fontSize: 20,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -285,6 +285,8 @@ class _GetPaidPageState extends State<GetPaidPage> {
|
|||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
Expanded(child: Container()),
|
||||||
|
HomeBottomMenuWidget()
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -3,14 +3,16 @@ import 'dart:convert';
|
|||||||
import 'package:cathaypay_mobile/GetPaid/GetPaidByAmount.dart';
|
import 'package:cathaypay_mobile/GetPaid/GetPaidByAmount.dart';
|
||||||
import 'package:cathaypay_mobile/TopUp/TopUpMenuPage.dart';
|
import 'package:cathaypay_mobile/TopUp/TopUpMenuPage.dart';
|
||||||
import 'package:cathaypay_mobile/model/qrcode.dart';
|
import 'package:cathaypay_mobile/model/qrcode.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:image_gallery_saver/image_gallery_saver.dart';
|
|
||||||
import 'package:qr_flutter/qr_flutter.dart';
|
import 'package:qr_flutter/qr_flutter.dart';
|
||||||
|
import 'package:saver_gallery/saver_gallery.dart';
|
||||||
|
|
||||||
import '../Home/HomePage.dart';
|
import '../Home/HomePage.dart';
|
||||||
import '../api/api.dart';
|
import '../api/api.dart';
|
||||||
|
import '../utils/color_custom.dart';
|
||||||
import '../utils/utils.dart';
|
import '../utils/utils.dart';
|
||||||
import 'GetPaidShopByAmount.dart';
|
import 'GetPaidShopByAmount.dart';
|
||||||
|
|
||||||
@@ -55,7 +57,8 @@ class _GetPaidPageState extends State<GetPaidShopPage> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
saveQrCode() {
|
saveQrCode() {
|
||||||
ImageGallerySaver.saveImage(base64Decode(myQrCode?.qrCodeImage ?? ""));
|
String fileName = "neopay_${DateTime.now().millisecondsSinceEpoch}.jpg";
|
||||||
|
SaverGallery.saveImage(base64Decode(myQrCode?.qrCodeImage ?? ""), fileName: fileName, skipIfExists: false);
|
||||||
Utils.showAlertDialog(context, "บันทึกสำเร็จ");
|
Utils.showAlertDialog(context, "บันทึกสำเร็จ");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -263,27 +266,23 @@ class _GetPaidPageState extends State<GetPaidShopPage> {
|
|||||||
onTap: () {
|
onTap: () {
|
||||||
saveQrCode();
|
saveQrCode();
|
||||||
},
|
},
|
||||||
child: Container(
|
child: SizedBox(
|
||||||
width: 147,
|
width: 147,
|
||||||
height: 44,
|
child: Card(
|
||||||
decoration: BoxDecoration(
|
color: Colors.white,
|
||||||
borderRadius: BorderRadius.circular(100),
|
shape: RoundedRectangleBorder(
|
||||||
boxShadow: [
|
borderRadius: BorderRadius.circular(40),
|
||||||
BoxShadow(
|
),
|
||||||
color: Color(0x19000000),
|
child: Container(
|
||||||
blurRadius: 2,
|
padding: EdgeInsets.all(10),
|
||||||
offset: Offset(0.75, 1),
|
child: Text(
|
||||||
),
|
"Save QR".tr(),
|
||||||
],
|
textAlign: TextAlign.center,
|
||||||
color: Color(0xff9d001b),
|
style: GoogleFonts.kanit(
|
||||||
),
|
color: ColorCustom.greyBorder,
|
||||||
child: Center(
|
fontSize: 20,
|
||||||
child: Text(
|
fontWeight: FontWeight.w500,
|
||||||
"บันทึก QR",
|
),
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: TextStyle(
|
|
||||||
color: Colors.white,
|
|
||||||
fontSize: 20,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:carousel_slider/carousel_slider.dart';
|
import 'package:carousel_slider/carousel_slider.dart';
|
||||||
import 'package:cathaypay_mobile/GetPaid/GetPaid.dart';
|
import 'package:cathaypay_mobile/GetPaid/GetPaid.dart';
|
||||||
@@ -9,9 +10,11 @@ import 'package:cathaypay_mobile/TopUp/TopUpMenuPage.dart';
|
|||||||
import 'package:cathaypay_mobile/TransferMoney/TransferMoneyMenu.dart';
|
import 'package:cathaypay_mobile/TransferMoney/TransferMoneyMenu.dart';
|
||||||
import 'package:cathaypay_mobile/model/banner_model.dart';
|
import 'package:cathaypay_mobile/model/banner_model.dart';
|
||||||
import 'package:cathaypay_mobile/model/profile_model.dart';
|
import 'package:cathaypay_mobile/model/profile_model.dart';
|
||||||
|
import 'package:device_info_plus/device_info_plus.dart';
|
||||||
import 'package:easy_localization/easy_localization.dart';
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
|
import 'package:permission_handler/permission_handler.dart';
|
||||||
import 'package:pull_to_refresh_flutter3/pull_to_refresh_flutter3.dart';
|
import 'package:pull_to_refresh_flutter3/pull_to_refresh_flutter3.dart';
|
||||||
import 'package:shared_preferences/shared_preferences.dart';
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
@@ -19,6 +22,7 @@ import 'package:url_launcher/url_launcher.dart';
|
|||||||
import '../api/api.dart';
|
import '../api/api.dart';
|
||||||
import '../model/promotion_model.dart';
|
import '../model/promotion_model.dart';
|
||||||
import '../model/token_model.dart';
|
import '../model/token_model.dart';
|
||||||
|
import '../utils/color_custom.dart';
|
||||||
import '../utils/utils.dart';
|
import '../utils/utils.dart';
|
||||||
|
|
||||||
Profile? profile;
|
Profile? profile;
|
||||||
@@ -40,9 +44,38 @@ class _HomePageState extends State<HomePage> {
|
|||||||
getTokenAdmin();
|
getTokenAdmin();
|
||||||
getBanner();
|
getBanner();
|
||||||
getPromotion();
|
getPromotion();
|
||||||
|
checkAndRequestPermissions(skipIfExists: true);
|
||||||
super.initState();
|
super.initState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<bool> checkAndRequestPermissions({required bool skipIfExists}) async {
|
||||||
|
if (!Platform.isAndroid && !Platform.isIOS) {
|
||||||
|
return false; // Only Android and iOS platforms are supported
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Platform.isAndroid) {
|
||||||
|
final deviceInfo = await DeviceInfoPlugin().androidInfo;
|
||||||
|
final sdkInt = deviceInfo.version.sdkInt;
|
||||||
|
|
||||||
|
if (skipIfExists) {
|
||||||
|
// Read permission is required to check if the file already exists
|
||||||
|
return sdkInt >= 33
|
||||||
|
? await Permission.photos.request().isGranted
|
||||||
|
: await Permission.storage.request().isGranted;
|
||||||
|
} else {
|
||||||
|
// No read permission required for Android SDK 29 and above
|
||||||
|
return sdkInt >= 29 ? true : await Permission.storage.request().isGranted;
|
||||||
|
}
|
||||||
|
} else if (Platform.isIOS) {
|
||||||
|
// iOS permission for saving images to the gallery
|
||||||
|
return skipIfExists
|
||||||
|
? await Permission.photos.request().isGranted
|
||||||
|
: await Permission.photosAddOnly.request().isGranted;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false; // Unsupported platforms
|
||||||
|
}
|
||||||
|
|
||||||
Future<void> getProfile() async {
|
Future<void> getProfile() async {
|
||||||
Api.get(context, Api.profile).then((value) => {
|
Api.get(context, Api.profile).then((value) => {
|
||||||
if (value != null) {initProfile(value)} else {clearProfile()}
|
if (value != null) {initProfile(value)} else {clearProfile()}
|
||||||
@@ -206,13 +239,13 @@ class _HomePageState extends State<HomePage> {
|
|||||||
children: [
|
children: [
|
||||||
context.locale.toString() == "th"
|
context.locale.toString() == "th"
|
||||||
? Image.asset(
|
? Image.asset(
|
||||||
"images/home/lang_20.png",
|
"images/home/lang_20.png",
|
||||||
width: 20,
|
width: 20,
|
||||||
)
|
)
|
||||||
: Image.asset(
|
: Image.asset(
|
||||||
"images/home/lang_21.png",
|
"images/home/lang_21.png",
|
||||||
width: 20,
|
width: 20,
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 5,
|
width: 5,
|
||||||
),
|
),
|
||||||
@@ -391,7 +424,7 @@ class _HomePageState extends State<HomePage> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
/* Container(
|
/* Container(
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
@@ -485,7 +518,7 @@ class _HomePageState extends State<HomePage> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
)*/
|
)*/
|
||||||
HomeBottomMenuWidget()
|
HomeBottomMenuWidget()
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -609,44 +642,39 @@ class _CardHomePageState extends State<CardHomePage> {
|
|||||||
return SafeArea(child: TopUpMenuPage());
|
return SafeArea(child: TopUpMenuPage());
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
child: Container(
|
child: SizedBox(
|
||||||
width: 160,
|
width: 160,
|
||||||
decoration: BoxDecoration(
|
child: Card(
|
||||||
borderRadius: BorderRadius.circular(100),
|
color: Colors.white,
|
||||||
boxShadow: [
|
shape: RoundedRectangleBorder(
|
||||||
BoxShadow(
|
borderRadius: BorderRadius.circular(40),
|
||||||
color: Color(0x19000000),
|
),
|
||||||
blurRadius: 4,
|
child: Container(
|
||||||
offset: Offset(1, 1),
|
padding: EdgeInsets.all(10),
|
||||||
),
|
child: Row(
|
||||||
],
|
mainAxisSize: MainAxisSize.min,
|
||||||
color: Color(0xffd0315a),
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
),
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
padding: const EdgeInsets.symmetric(
|
children: [
|
||||||
horizontal: 12,
|
SizedBox(
|
||||||
vertical: 15,
|
height: 30,
|
||||||
),
|
child: Text(
|
||||||
child: Row(
|
"Wallet Topup".tr(),
|
||||||
mainAxisSize: MainAxisSize.min,
|
style: GoogleFonts.kanit(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
color: ColorCustom.red,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
fontSize: 18,
|
||||||
children: [
|
),
|
||||||
SizedBox(
|
),
|
||||||
height: 30,
|
|
||||||
child: Text(
|
|
||||||
"Wallet Topup".tr(),
|
|
||||||
style: GoogleFonts.kanit(
|
|
||||||
color: Colors.white,
|
|
||||||
fontSize: 18,
|
|
||||||
),
|
),
|
||||||
),
|
Spacer(),
|
||||||
|
Image(
|
||||||
|
image: AssetImage('images/home/icon_plus.png'),
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
color: ColorCustom.red,
|
||||||
|
)
|
||||||
|
],
|
||||||
),
|
),
|
||||||
Spacer(),
|
),
|
||||||
Image(
|
|
||||||
image: AssetImage('images/home/icon_plus.png'),
|
|
||||||
fit: BoxFit.cover,
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -749,48 +777,43 @@ class _CardHomePageState extends State<CardHomePage> {
|
|||||||
return SafeArea(child: PayPage());
|
return SafeArea(child: PayPage());
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
child: Container(
|
child: SizedBox(
|
||||||
width: 160,
|
width: 160,
|
||||||
decoration: BoxDecoration(
|
child: Card(
|
||||||
borderRadius: BorderRadius.circular(100),
|
color: Colors.white,
|
||||||
boxShadow: [
|
shape: RoundedRectangleBorder(
|
||||||
BoxShadow(
|
borderRadius: BorderRadius.circular(40),
|
||||||
color: Color(0x19000000),
|
),
|
||||||
blurRadius: 4,
|
child: Container(
|
||||||
offset: Offset(1, 1),
|
padding: EdgeInsets.all(10),
|
||||||
),
|
child: Row(
|
||||||
],
|
mainAxisSize: MainAxisSize.min,
|
||||||
color: Color(0xfff2f2f2),
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
),
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
padding: const EdgeInsets.symmetric(
|
children: [
|
||||||
horizontal: 12,
|
SizedBox(
|
||||||
vertical: 15,
|
height: 30,
|
||||||
),
|
child: Text(
|
||||||
child: Row(
|
"Pay".tr(),
|
||||||
mainAxisSize: MainAxisSize.min,
|
style: GoogleFonts.kanit(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
color: ColorCustom.red,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
fontSize: 18,
|
||||||
children: [
|
),
|
||||||
SizedBox(
|
),
|
||||||
height: 30,
|
|
||||||
child: Text(
|
|
||||||
"Pay".tr(),
|
|
||||||
style: GoogleFonts.kanit(
|
|
||||||
color: Color(0xffd0315a),
|
|
||||||
fontSize: 18,
|
|
||||||
),
|
),
|
||||||
),
|
Spacer(),
|
||||||
|
Container(
|
||||||
|
width: 21,
|
||||||
|
height: 21,
|
||||||
|
child: Image(
|
||||||
|
image: AssetImage('images/home/icon_qr.png'),
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
color: ColorCustom.red,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
),
|
),
|
||||||
Spacer(),
|
),
|
||||||
Container(
|
|
||||||
width: 21,
|
|
||||||
height: 21,
|
|
||||||
child: Image(
|
|
||||||
image: AssetImage('images/home/icon_qr.png'),
|
|
||||||
fit: BoxFit.cover,
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -819,43 +842,25 @@ class _MenuHomePageState extends State<MenuHomePage> {
|
|||||||
Row(
|
Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Expanded(child: InkWell(
|
Expanded(
|
||||||
onTap: () {
|
child: InkWell(
|
||||||
showModalBottomSheet<void>(
|
onTap: () {
|
||||||
context: context,
|
showModalBottomSheet<void>(
|
||||||
isScrollControlled: true,
|
context: context,
|
||||||
useSafeArea: true,
|
isScrollControlled: true,
|
||||||
builder: (BuildContext context) {
|
useSafeArea: true,
|
||||||
return GetPaidPage();
|
builder: (BuildContext context) {
|
||||||
});
|
return GetPaidPage();
|
||||||
},
|
});
|
||||||
child: Container(
|
},
|
||||||
decoration: BoxDecoration(
|
child: Image(
|
||||||
borderRadius: BorderRadius.circular(10),
|
width: 80,
|
||||||
color: Colors.white,
|
height: 80,
|
||||||
),
|
image: context.locale.toString() == "th" ? AssetImage('images/menu/27.png') : AssetImage('images/menu/22.png'),
|
||||||
child: Column(
|
fit: BoxFit.fitHeight,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
),
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Image(
|
|
||||||
width: 50,
|
|
||||||
height: 50,
|
|
||||||
image: AssetImage('images/home/1.png'),
|
|
||||||
fit: BoxFit.cover,
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
"Receive Money".tr(),
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: GoogleFonts.kanit(
|
|
||||||
color: Color(0xff65676b),
|
|
||||||
fontSize: 13,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),),
|
|
||||||
/* InkWell(
|
/* InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
showModalBottomSheet<void>(
|
showModalBottomSheet<void>(
|
||||||
@@ -898,83 +903,47 @@ class _MenuHomePageState extends State<MenuHomePage> {
|
|||||||
SizedBox(
|
SizedBox(
|
||||||
width: 10,
|
width: 10,
|
||||||
),
|
),
|
||||||
Expanded(child: InkWell(
|
Expanded(
|
||||||
onTap: () {
|
child: InkWell(
|
||||||
showModalBottomSheet(
|
onTap: () {
|
||||||
context: context,
|
showModalBottomSheet(
|
||||||
isScrollControlled: true,
|
context: context,
|
||||||
useSafeArea: true,
|
isScrollControlled: true,
|
||||||
builder: (BuildContext context) {
|
useSafeArea: true,
|
||||||
return TransferMoneyMenuPage();
|
builder: (BuildContext context) {
|
||||||
});
|
return TransferMoneyMenuPage();
|
||||||
},
|
});
|
||||||
child: Container(
|
},
|
||||||
decoration: BoxDecoration(
|
child: Image(
|
||||||
borderRadius: BorderRadius.circular(10),
|
width: 80,
|
||||||
color: Colors.white,
|
height: 80,
|
||||||
),
|
image: context.locale.toString() == "th" ? AssetImage('images/menu/26.png') : AssetImage('images/menu/23.png'),
|
||||||
child: Column(
|
fit: BoxFit.fitHeight,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
),
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
),
|
||||||
children: [
|
),
|
||||||
Image(
|
|
||||||
width: 50,
|
|
||||||
height: 50,
|
|
||||||
image: AssetImage('images/home/2.png'),
|
|
||||||
fit: BoxFit.cover,
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
"Transfer Money".tr(),
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: GoogleFonts.kanit(
|
|
||||||
color: Color(0xff65676b),
|
|
||||||
fontSize: 13,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),),
|
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 10,
|
width: 10,
|
||||||
),
|
),
|
||||||
Expanded(child: InkWell(
|
Expanded(
|
||||||
onTap: () {
|
child: InkWell(
|
||||||
showModalBottomSheet<void>(
|
onTap: () {
|
||||||
context: context,
|
showModalBottomSheet<void>(
|
||||||
isScrollControlled: true,
|
context: context,
|
||||||
useSafeArea: true,
|
isScrollControlled: true,
|
||||||
builder: (BuildContext context) {
|
useSafeArea: true,
|
||||||
return PayPage();
|
builder: (BuildContext context) {
|
||||||
});
|
return PayPage();
|
||||||
},
|
});
|
||||||
child: Container(
|
},
|
||||||
decoration: BoxDecoration(
|
child: Image(
|
||||||
borderRadius: BorderRadius.circular(10),
|
width: 80,
|
||||||
color: Colors.white,
|
height: 80,
|
||||||
),
|
image: context.locale.toString() == "th" ? AssetImage('images/menu/25.png') : AssetImage('images/menu/24.png'),
|
||||||
child: Column(
|
fit: BoxFit.fitHeight,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
),
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
),
|
||||||
children: [
|
),
|
||||||
Image(
|
|
||||||
width: 50,
|
|
||||||
height: 50,
|
|
||||||
image: AssetImage('images/home/5.png'),
|
|
||||||
fit: BoxFit.cover,
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
"Pay".tr(),
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: GoogleFonts.kanit(
|
|
||||||
color: Color(0xff65676b),
|
|
||||||
fontSize: 13,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),),
|
|
||||||
/* InkWell(
|
/* InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
showModalBottomSheet<void>(
|
showModalBottomSheet<void>(
|
||||||
|
|||||||
169
neowallet_mobile/lib/Home/all_menu.dart
Normal file
@@ -0,0 +1,169 @@
|
|||||||
|
import 'package:cathaypay_mobile/Home/HomePage.dart';
|
||||||
|
import 'package:cathaypay_mobile/Home/home_bottom_menu_widget.dart';
|
||||||
|
import 'package:cathaypay_mobile/model/menu_icon_model.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 'package:url_launcher/url_launcher.dart';
|
||||||
|
|
||||||
|
import '../GetPaid/GetPaid.dart';
|
||||||
|
import '../Pay/PayPage.dart';
|
||||||
|
import '../TopUp/TopUpMenuPage.dart';
|
||||||
|
import '../TransferMoney/TransferMoneyMenu.dart';
|
||||||
|
import '../api/api.dart';
|
||||||
|
|
||||||
|
class AllMenuPage extends StatefulWidget {
|
||||||
|
const AllMenuPage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<AllMenuPage> createState() => _PolicyPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _PolicyPageState extends State<AllMenuPage> {
|
||||||
|
var controller;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
||||||
|
if (context.locale.toString() == "th") {
|
||||||
|
listMenu.add(MenuIconModel(fileUrl: "images/menu/27.png", localID: 0));
|
||||||
|
listMenu.add(MenuIconModel(fileUrl: "images/menu/26.png", localID: 1));
|
||||||
|
listMenu.add(MenuIconModel(fileUrl: "images/menu/25.png", localID: 2));
|
||||||
|
listMenu.add(MenuIconModel(fileUrl: "images/menu/31.png", localID: 3));
|
||||||
|
} else {
|
||||||
|
listMenu.add(MenuIconModel(fileUrl: "images/menu/22.png", localID: 0));
|
||||||
|
listMenu.add(MenuIconModel(fileUrl: "images/menu/23.png", localID: 1));
|
||||||
|
listMenu.add(MenuIconModel(fileUrl: "images/menu/24.png", localID: 2));
|
||||||
|
listMenu.add(MenuIconModel(fileUrl: "images/menu/32.png", localID: 3));
|
||||||
|
}
|
||||||
|
|
||||||
|
getMenu();
|
||||||
|
});
|
||||||
|
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
|
List<MenuIconModel> listMenu = [];
|
||||||
|
|
||||||
|
getMenu() {
|
||||||
|
Api.get(context, Api.menuIcons).then((value) => {
|
||||||
|
if (value != null)
|
||||||
|
{
|
||||||
|
setState(() {
|
||||||
|
value.forEach((v) {
|
||||||
|
listMenu.add(MenuIconModel.fromJson(v));
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _launchUrl(String url) async {
|
||||||
|
if (!await launchUrl(Uri.parse(url))) {
|
||||||
|
throw Exception('Could not launch $url');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
// extendBodyBehindAppBar: true,
|
||||||
|
|
||||||
|
appBar: AppBar(
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
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: Column(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(20.0),
|
||||||
|
child: GridView.count(
|
||||||
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
|
shrinkWrap: true,
|
||||||
|
crossAxisCount: 4,
|
||||||
|
childAspectRatio: 1 / 1,
|
||||||
|
mainAxisSpacing: 5.0,
|
||||||
|
crossAxisSpacing: 5.0,
|
||||||
|
children: listMenu.map((MenuIconModel promo) {
|
||||||
|
return InkWell(
|
||||||
|
onTap: () {
|
||||||
|
switch (promo.localID) {
|
||||||
|
case 0:
|
||||||
|
showModalBottomSheet<void>(
|
||||||
|
context: context,
|
||||||
|
isScrollControlled: true,
|
||||||
|
useSafeArea: true,
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return GetPaidPage();
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
showModalBottomSheet(
|
||||||
|
context: context,
|
||||||
|
isScrollControlled: true,
|
||||||
|
useSafeArea: true,
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return TransferMoneyMenuPage();
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
showModalBottomSheet(
|
||||||
|
context: context,
|
||||||
|
isScrollControlled: true,
|
||||||
|
useSafeArea: true,
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return PayPage();
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
showModalBottomSheet(
|
||||||
|
context: context,
|
||||||
|
isScrollControlled: true,
|
||||||
|
useSafeArea: true,
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return SafeArea(child: TopUpMenuPage());
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
String url = "${promo.link}?token=${promo.token}&id=${profile?.id}&mobile=${profile?.phoneNumber}&email=${profile?.email}";
|
||||||
|
print(url);
|
||||||
|
_launchUrl( url);
|
||||||
|
},
|
||||||
|
child: promo.fileUrl != null
|
||||||
|
? promo.fileUrl!.startsWith("http")
|
||||||
|
? Image.network(promo.fileUrl ?? "")
|
||||||
|
: Image.asset(promo.fileUrl ?? "")
|
||||||
|
: Container(),
|
||||||
|
);
|
||||||
|
}).toList()),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
HomeBottomMenuWidget()
|
||||||
|
],
|
||||||
|
)),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import 'package:cathaypay_mobile/Home/all_menu.dart';
|
||||||
import 'package:easy_localization/easy_localization.dart';
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
@@ -27,7 +28,7 @@ class _HomePageState extends State<HomeBottomMenuWidget> {
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Container(
|
Container(
|
||||||
width: MediaQuery.of(context).size.width,
|
width: MediaQuery.of(context).size.width,
|
||||||
padding: EdgeInsets.all(20),
|
padding: EdgeInsets.all(10),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
boxShadow: [BoxShadow(color: Color.fromRGBO(0, 0, 0, 0.07999999821186066), offset: Offset(0, -4), blurRadius: 4)],
|
boxShadow: [BoxShadow(color: Color.fromRGBO(0, 0, 0, 0.07999999821186066), offset: Offset(0, -4), blurRadius: 4)],
|
||||||
color: Color.fromRGBO(255, 255, 255, 1),
|
color: Color.fromRGBO(255, 255, 255, 1),
|
||||||
@@ -42,10 +43,10 @@ class _HomePageState extends State<HomeBottomMenuWidget> {
|
|||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
height: 35,
|
height: 45,
|
||||||
width: 35,
|
width: 45,
|
||||||
child: Image(
|
child: Image(
|
||||||
image: AssetImage('images/home/1.home.png'),
|
image: AssetImage('images/home/15.png'),
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -70,10 +71,10 @@ class _HomePageState extends State<HomeBottomMenuWidget> {
|
|||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
height: 35,
|
height: 45,
|
||||||
width: 35,
|
width: 45,
|
||||||
child: Image(
|
child: Image(
|
||||||
image: AssetImage('images/home/2.scan.png'),
|
image: AssetImage('images/home/17.png'),
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -101,17 +102,24 @@ class _HomePageState extends State<HomeBottomMenuWidget> {
|
|||||||
),
|
),
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
// clearProfile();
|
Navigator.popUntil(context, ModalRoute.withName('/'));
|
||||||
|
Navigator.pushNamed(context, '/HomePage');
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (context) => AllMenuPage(),
|
||||||
|
),
|
||||||
|
);
|
||||||
},
|
},
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
height: 35,
|
height: 45,
|
||||||
width: 35,
|
width: 45,
|
||||||
child: Image(
|
child: Image(
|
||||||
image: AssetImage('images/home/3.all.png'),
|
image: AssetImage('images/home/19.png'),
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import 'package:package_info_plus/package_info_plus.dart';
|
|||||||
import 'package:shared_preferences/shared_preferences.dart';
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
|
|
||||||
import '../PinCodeVadidate.dart';
|
import '../PinCodeVadidate.dart';
|
||||||
import '../Register/register_data.dart';
|
|
||||||
import '../api/api.dart';
|
import '../api/api.dart';
|
||||||
import '../model/token_model.dart';
|
import '../model/token_model.dart';
|
||||||
import '../utils/color_custom.dart';
|
import '../utils/color_custom.dart';
|
||||||
@@ -41,13 +40,9 @@ class _LoginPageState extends State<LoginPage> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> getProfile() async {
|
Future<void> getProfile() async {
|
||||||
Api.get(context, Api.profile).then((value) =>
|
Api.get(context, Api.profile).then((value) => {
|
||||||
{
|
if (value != null) {initProfile()} else {clearProfile()}
|
||||||
if (value != null) {
|
});
|
||||||
initProfile()
|
|
||||||
} else
|
|
||||||
{clearProfile()}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
initProfile() async {
|
initProfile() async {
|
||||||
@@ -69,9 +64,7 @@ class _LoginPageState extends State<LoginPage> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
refresh() {
|
refresh() {
|
||||||
setState(() {
|
setState(() {});
|
||||||
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
String version = "";
|
String version = "";
|
||||||
@@ -90,15 +83,11 @@ class _LoginPageState extends State<LoginPage> {
|
|||||||
return Scaffold(
|
return Scaffold(
|
||||||
body: Stack(children: <Widget>[
|
body: Stack(children: <Widget>[
|
||||||
Container(
|
Container(
|
||||||
width: MediaQuery
|
width: MediaQuery.of(context).size.width,
|
||||||
.of(context)
|
height: MediaQuery.of(context).size.height,
|
||||||
.size
|
child: Container(
|
||||||
.width,
|
color: Colors.white,
|
||||||
height: MediaQuery
|
),
|
||||||
.of(context)
|
|
||||||
.size
|
|
||||||
.height,
|
|
||||||
child: Container(color: Colors.white,),
|
|
||||||
),
|
),
|
||||||
Column(
|
Column(
|
||||||
children: [
|
children: [
|
||||||
@@ -124,10 +113,7 @@ class _LoginPageState extends State<LoginPage> {
|
|||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
width: MediaQuery
|
width: MediaQuery.of(context).size.width,
|
||||||
.of(context)
|
|
||||||
.size
|
|
||||||
.width,
|
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
@@ -168,8 +154,15 @@ class _LoginPageState extends State<LoginPage> {
|
|||||||
}
|
}
|
||||||
refresh();
|
refresh();
|
||||||
},
|
},
|
||||||
child: context.locale.toString() == "th"?Image.asset("images/home/lang_1.png",width: 80,):Image.asset("images/home/lang_2.png",width: 80,)
|
child: context.locale.toString() == "th"
|
||||||
)
|
? Image.asset(
|
||||||
|
"images/home/lang_1.png",
|
||||||
|
width: 80,
|
||||||
|
)
|
||||||
|
: Image.asset(
|
||||||
|
"images/home/lang_2.png",
|
||||||
|
width: 80,
|
||||||
|
))
|
||||||
],
|
],
|
||||||
)),
|
)),
|
||||||
Spacer(),
|
Spacer(),
|
||||||
@@ -177,41 +170,29 @@ class _LoginPageState extends State<LoginPage> {
|
|||||||
onTap: () {
|
onTap: () {
|
||||||
Navigator.pushNamed(context, '/LoginValidate');
|
Navigator.pushNamed(context, '/LoginValidate');
|
||||||
},
|
},
|
||||||
child: Container(
|
child: SizedBox(
|
||||||
width: MediaQuery
|
width: double.infinity,
|
||||||
.of(context)
|
child: Card(
|
||||||
.size
|
color: Colors.white,
|
||||||
.width,
|
shape: RoundedRectangleBorder(
|
||||||
decoration: BoxDecoration(
|
borderRadius: BorderRadius.circular(40),
|
||||||
borderRadius: BorderRadius.circular(40),
|
side: BorderSide(color: ColorCustom.red, width: 1)
|
||||||
border: Border.all(
|
|
||||||
color: Color(0xff9d001b),
|
|
||||||
width: 1,
|
|
||||||
),
|
),
|
||||||
),
|
child: Container(
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: EdgeInsets.all(10),
|
||||||
horizontal: 10,
|
child: Text(
|
||||||
vertical: 12,
|
"Log In".tr(),
|
||||||
),
|
textAlign: TextAlign.center,
|
||||||
child: Row(
|
style: GoogleFonts.kanit(
|
||||||
mainAxisSize: MainAxisSize.min,
|
color: ColorCustom.red,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
fontSize: 20,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
fontWeight: FontWeight.w500,
|
||||||
children: [
|
|
||||||
SizedBox(
|
|
||||||
child: Text(
|
|
||||||
"Log In".tr(),
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: GoogleFonts.kanit(
|
|
||||||
color: Color(0xff9d001b),
|
|
||||||
fontSize: 20,
|
|
||||||
fontWeight: FontWeight.w300,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
),
|
),
|
||||||
SizedBox(height: 10),
|
SizedBox(height: 10),
|
||||||
InkWell(
|
InkWell(
|
||||||
@@ -229,36 +210,25 @@ class _LoginPageState extends State<LoginPage> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
child: Container(
|
child: SizedBox(
|
||||||
width: MediaQuery
|
width: double.infinity,
|
||||||
.of(context)
|
child: Card(
|
||||||
.size
|
color: Colors.white,
|
||||||
.width,
|
shape: RoundedRectangleBorder(
|
||||||
decoration: BoxDecoration(
|
borderRadius: BorderRadius.circular(40),
|
||||||
borderRadius: BorderRadius.circular(40),
|
),
|
||||||
color: Color(0xffd0315a),
|
child: Container(
|
||||||
),
|
padding: EdgeInsets.all(10),
|
||||||
padding: const EdgeInsets.symmetric(
|
child: Text(
|
||||||
horizontal: 10,
|
"Register".tr(),
|
||||||
vertical: 12,
|
textAlign: TextAlign.center,
|
||||||
),
|
style: GoogleFonts.kanit(
|
||||||
child: Row(
|
color: ColorCustom.red,
|
||||||
mainAxisSize: MainAxisSize.min,
|
fontSize: 20,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
fontWeight: FontWeight.w500,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
SizedBox(
|
|
||||||
child: Text(
|
|
||||||
"Register".tr(),
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: GoogleFonts.kanit(
|
|
||||||
color: Colors.white,
|
|
||||||
fontSize: 20,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import 'package:package_info_plus/package_info_plus.dart';
|
|||||||
import 'package:shared_preferences/shared_preferences.dart';
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
|
|
||||||
import '../api/api.dart';
|
import '../api/api.dart';
|
||||||
|
import '../utils/color_custom.dart';
|
||||||
|
|
||||||
TokenModel? tokenModel;
|
TokenModel? tokenModel;
|
||||||
|
|
||||||
@@ -106,7 +107,7 @@ class _LoginValidateState extends State<LoginValidate> {
|
|||||||
|
|
||||||
// TextEditingController username = TextEditingController(text: "admin");
|
// TextEditingController username = TextEditingController(text: "admin");
|
||||||
// TextEditingController password = TextEditingController(text: "P@ssword1");
|
// TextEditingController password = TextEditingController(text: "P@ssword1");
|
||||||
// TextEditingController username = TextEditingController(text: "toontest");
|
// TextEditingController username = TextEditingController(text: "nataphonpan");
|
||||||
// TextEditingController password = TextEditingController(text: "123456Aa");
|
// TextEditingController password = TextEditingController(text: "123456Aa");
|
||||||
TextEditingController username = TextEditingController();
|
TextEditingController username = TextEditingController();
|
||||||
TextEditingController password = TextEditingController();
|
TextEditingController password = TextEditingController();
|
||||||
@@ -229,28 +230,25 @@ class _LoginValidateState extends State<LoginValidate> {
|
|||||||
}
|
}
|
||||||
authen(context);
|
authen(context);
|
||||||
},
|
},
|
||||||
child: Container(
|
child: SizedBox(
|
||||||
width: 374,
|
width: double.infinity,
|
||||||
height: 48,
|
child: Card(
|
||||||
decoration: BoxDecoration(
|
color: Colors.white,
|
||||||
borderRadius: BorderRadius.circular(100),
|
shape: RoundedRectangleBorder(
|
||||||
color: Color(0xff9d001b),
|
borderRadius: BorderRadius.circular(40),
|
||||||
),
|
),
|
||||||
child: Row(
|
child: Container(
|
||||||
mainAxisSize: MainAxisSize.min,
|
padding: EdgeInsets.all(10),
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
child: Text(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
"Next".tr(),
|
"Next".tr(),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: GoogleFonts.kanit(
|
style: GoogleFonts.kanit(
|
||||||
color: Colors.white,
|
color: ColorCustom.greyBorder,
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -299,7 +299,7 @@ class _PayPageState extends State<PayPage> {
|
|||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
"สแกน QR Code CATHAY PAY".tr(),
|
"สแกน QR Code NEO PAY".tr(),
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import 'package:mask_text_input_formatter/mask_text_input_formatter.dart';
|
|||||||
|
|
||||||
import '../TransferMoney/TransferPromtptPayDialog.dart';
|
import '../TransferMoney/TransferPromtptPayDialog.dart';
|
||||||
import '../api/api.dart';
|
import '../api/api.dart';
|
||||||
|
import '../utils/color_custom.dart';
|
||||||
|
|
||||||
class PayPromptPay extends StatefulWidget {
|
class PayPromptPay extends StatefulWidget {
|
||||||
const PayPromptPay({Key? key}) : super(key: key);
|
const PayPromptPay({Key? key}) : super(key: key);
|
||||||
@@ -97,36 +98,24 @@ class _TransferPromptPayState extends State<PayPromptPay> {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
margin: EdgeInsets.only(left: 20, right: 20),
|
width: double.infinity,
|
||||||
width: MediaQuery.of(context).size.width,
|
margin: const EdgeInsets.symmetric(horizontal: 15),
|
||||||
height: 51,
|
child: Card(
|
||||||
decoration: BoxDecoration(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(40),
|
borderRadius: BorderRadius.circular(40),
|
||||||
color: Color(0xff9d001b),
|
),
|
||||||
),
|
child: Container(
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: EdgeInsets.all(10),
|
||||||
horizontal: 10,
|
child: Text(
|
||||||
vertical: 12,
|
"Next".tr(),
|
||||||
),
|
textAlign: TextAlign.center,
|
||||||
child: Row(
|
style: GoogleFonts.kanit(
|
||||||
mainAxisSize: MainAxisSize.min,
|
color: ColorCustom.greyBorder,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
fontSize: 20,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
fontWeight: FontWeight.w500,
|
||||||
children: [
|
|
||||||
SizedBox(
|
|
||||||
width: 106,
|
|
||||||
height: 32,
|
|
||||||
child: Text(
|
|
||||||
"Next".tr(),
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: GoogleFonts.kanit(
|
|
||||||
color: Colors.white,
|
|
||||||
fontSize: 20,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -425,36 +414,24 @@ class _TransferPromptPayDetailState extends State<TransferPromptPayDetail> {
|
|||||||
Utils.showAlertDialog(context, "Price must more than 10 Baht");
|
Utils.showAlertDialog(context, "Price must more than 10 Baht");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Container(
|
child: SizedBox(
|
||||||
width: MediaQuery.of(context).size.width,
|
width: double.infinity,
|
||||||
height: 51,
|
child: Card(
|
||||||
decoration: BoxDecoration(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(40),
|
borderRadius: BorderRadius.circular(40),
|
||||||
color: Color(0xff9d001b),
|
),
|
||||||
),
|
child: Container(
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: EdgeInsets.all(10),
|
||||||
horizontal: 10,
|
child: Text(
|
||||||
vertical: 12,
|
"Confirm".tr(),
|
||||||
),
|
textAlign: TextAlign.center,
|
||||||
child: Row(
|
style: GoogleFonts.kanit(
|
||||||
mainAxisSize: MainAxisSize.min,
|
color: ColorCustom.greyBorder,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
fontSize: 20,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
fontWeight: FontWeight.w500,
|
||||||
children: [
|
|
||||||
SizedBox(
|
|
||||||
width: 106,
|
|
||||||
height: 32,
|
|
||||||
child: Text(
|
|
||||||
"Confirm".tr(),
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: GoogleFonts.kanit(
|
|
||||||
color: Colors.white,
|
|
||||||
fontSize: 20,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -4,14 +4,15 @@ import 'package:cathaypay_mobile/Home/HomePage.dart';
|
|||||||
import 'package:cathaypay_mobile/Pay/PayQrDialog.dart';
|
import 'package:cathaypay_mobile/Pay/PayQrDialog.dart';
|
||||||
import 'package:cathaypay_mobile/PinCodeVadidate.dart';
|
import 'package:cathaypay_mobile/PinCodeVadidate.dart';
|
||||||
import 'package:cathaypay_mobile/utils/utils.dart';
|
import 'package:cathaypay_mobile/utils/utils.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:intl/intl.dart';
|
|
||||||
import 'package:qr_code_scanner/qr_code_scanner.dart';
|
import 'package:qr_code_scanner/qr_code_scanner.dart';
|
||||||
|
|
||||||
import '../api/api.dart';
|
import '../api/api.dart';
|
||||||
|
import '../utils/color_custom.dart';
|
||||||
|
|
||||||
class PayQrPage extends StatefulWidget {
|
class PayQrPage extends StatefulWidget {
|
||||||
const PayQrPage({Key? key, required this.code}) : super(key: key);
|
const PayQrPage({Key? key, required this.code}) : super(key: key);
|
||||||
@@ -184,7 +185,7 @@ class _PayQrPageState extends State<PayQrPage> {
|
|||||||
],
|
],
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
title: Text(
|
title: Text(
|
||||||
"จ่ายเงิน",
|
"Pay".tr(),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: GoogleFonts.kanit(
|
style: GoogleFonts.kanit(
|
||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
@@ -201,7 +202,7 @@ class _PayQrPageState extends State<PayQrPage> {
|
|||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"ชื่อ",
|
"ชื่อ".tr(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Color(0xff65676b),
|
color: Color(0xff65676b),
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
@@ -240,7 +241,7 @@ class _PayQrPageState extends State<PayQrPage> {
|
|||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"เบอร์โทรศัพท์",
|
"เบอร์โทรศัพท์".tr(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Color(0xff65676b),
|
color: Color(0xff65676b),
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
@@ -262,7 +263,7 @@ class _PayQrPageState extends State<PayQrPage> {
|
|||||||
height: 10,
|
height: 10,
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"จำนวนเงินที่โอน / จ่าย",
|
"จำนวนเงินที่โอน / จ่าย".tr(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Color(0xff65676b),
|
color: Color(0xff65676b),
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
@@ -318,7 +319,7 @@ class _PayQrPageState extends State<PayQrPage> {
|
|||||||
controller: price,
|
controller: price,
|
||||||
style: TextStyle(fontSize: 24),
|
style: TextStyle(fontSize: 24),
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
hintText: 'จำนวนเงินที่โอน',
|
hintText: "จำนวนเงินที่โอน / จ่าย".tr(),
|
||||||
border: InputBorder.none,
|
border: InputBorder.none,
|
||||||
contentPadding: EdgeInsets.symmetric(horizontal: 16),
|
contentPadding: EdgeInsets.symmetric(horizontal: 16),
|
||||||
),
|
),
|
||||||
@@ -328,7 +329,7 @@ class _PayQrPageState extends State<PayQrPage> {
|
|||||||
height: 10,
|
height: 10,
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"ใช้แต้ม Cathay Pay แทนเงินสด",
|
"ใช้แต้ม NEO PAY แทนเงินสด".tr(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Color(0xff65676b),
|
color: Color(0xff65676b),
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
@@ -336,7 +337,7 @@ class _PayQrPageState extends State<PayQrPage> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"คะแนนของคุณ : 12,000 แต้ม",
|
"${"คะแนนของคุณ".tr()} : 12,000 ${"แต้ม".tr()}",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Color(0xff9d001b),
|
color: Color(0xff9d001b),
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
@@ -361,7 +362,7 @@ class _PayQrPageState extends State<PayQrPage> {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"0 แต้ม",
|
"10 ${"แต้ม".tr()}",
|
||||||
textAlign: TextAlign.right,
|
textAlign: TextAlign.right,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Color(0xff65676b),
|
color: Color(0xff65676b),
|
||||||
@@ -395,7 +396,7 @@ class _PayQrPageState extends State<PayQrPage> {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"0 บาท",
|
"100 ${"Baht".tr()}",
|
||||||
textAlign: TextAlign.right,
|
textAlign: TextAlign.right,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
@@ -408,7 +409,7 @@ class _PayQrPageState extends State<PayQrPage> {
|
|||||||
),
|
),
|
||||||
Center(
|
Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
"1 แต้ม = 10 สตางค์",
|
"1 แต้ม = 10 สตางค์".tr(),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Color(0xff65676b),
|
color: Color(0xff65676b),
|
||||||
@@ -418,6 +419,8 @@ class _PayQrPageState extends State<PayQrPage> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
|
height: 136,
|
||||||
|
color: Colors.transparent,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
SizedBox(
|
||||||
@@ -426,7 +429,7 @@ class _PayQrPageState extends State<PayQrPage> {
|
|||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"ยอดเงินทั้งหมด",
|
"ยอดเงินทั้งหมด".tr(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Color(0xff65676b),
|
color: Color(0xff65676b),
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
@@ -443,7 +446,7 @@ class _PayQrPageState extends State<PayQrPage> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
" บาท",
|
" ${"Baht".tr()}",
|
||||||
textAlign: TextAlign.right,
|
textAlign: TextAlign.right,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Color(0xff65676b),
|
color: Color(0xff65676b),
|
||||||
@@ -465,36 +468,24 @@ class _PayQrPageState extends State<PayQrPage> {
|
|||||||
checkTypePay();
|
checkTypePay();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Container(
|
child: SizedBox(
|
||||||
width: MediaQuery.of(context).size.width,
|
width: double.infinity,
|
||||||
height: 51,
|
child: Card(
|
||||||
decoration: BoxDecoration(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(40),
|
borderRadius: BorderRadius.circular(40),
|
||||||
color: Color(0xff9d001b),
|
),
|
||||||
),
|
child: Container(
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: EdgeInsets.all(10),
|
||||||
horizontal: 10,
|
child: Text(
|
||||||
vertical: 12,
|
"Confirm".tr(),
|
||||||
),
|
textAlign: TextAlign.center,
|
||||||
child: Row(
|
style: GoogleFonts.kanit(
|
||||||
mainAxisSize: MainAxisSize.min,
|
color: ColorCustom.greyBorder,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
fontSize: 20,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
fontWeight: FontWeight.w500,
|
||||||
children: [
|
|
||||||
SizedBox(
|
|
||||||
width: 106,
|
|
||||||
height: 32,
|
|
||||||
child: Text(
|
|
||||||
"ยืนยัน",
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: GoogleFonts.kanit(
|
|
||||||
color: Colors.white,
|
|
||||||
fontSize: 20,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -503,8 +494,6 @@ class _PayQrPageState extends State<PayQrPage> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
height: 136,
|
|
||||||
color: Colors.transparent,
|
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 10,
|
height: 10,
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
|
import 'package:cathaypay_mobile/GetPaid/GetPaid.dart';
|
||||||
import 'package:cathaypay_mobile/Home/HomePage.dart';
|
import 'package:cathaypay_mobile/Home/HomePage.dart';
|
||||||
import 'package:cathaypay_mobile/Pay/PayQrDialog.dart';
|
import 'package:cathaypay_mobile/Pay/PayQrDialog.dart';
|
||||||
import 'package:cathaypay_mobile/PinCodeVadidate.dart';
|
import 'package:cathaypay_mobile/PinCodeVadidate.dart';
|
||||||
import 'package:cathaypay_mobile/main.dart';
|
import 'package:cathaypay_mobile/main.dart';
|
||||||
import 'package:cathaypay_mobile/utils/utils.dart';
|
import 'package:cathaypay_mobile/utils/utils.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
@@ -13,6 +15,7 @@ import 'package:intl/intl.dart';
|
|||||||
import 'package:qr_code_scanner/qr_code_scanner.dart';
|
import 'package:qr_code_scanner/qr_code_scanner.dart';
|
||||||
|
|
||||||
import '../api/api.dart';
|
import '../api/api.dart';
|
||||||
|
import '../utils/color_custom.dart';
|
||||||
|
|
||||||
class PayThaiQr extends StatefulWidget {
|
class PayThaiQr extends StatefulWidget {
|
||||||
const PayThaiQr({Key? key, required this.code}) : super(key: key);
|
const PayThaiQr({Key? key, required this.code}) : super(key: key);
|
||||||
@@ -95,7 +98,7 @@ class _PayQrPageState extends State<PayThaiQr> {
|
|||||||
],
|
],
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
title: Text(
|
title: Text(
|
||||||
"จ่ายเงิน",
|
"Pay".tr(),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: GoogleFonts.kanit(
|
style: GoogleFonts.kanit(
|
||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
@@ -112,7 +115,7 @@ class _PayQrPageState extends State<PayThaiQr> {
|
|||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"จำนวนเงินที่โอน / จ่าย",
|
"จำนวนเงินที่โอน / จ่าย".tr(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Color(0xff65676b),
|
color: Color(0xff65676b),
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
@@ -168,7 +171,7 @@ class _PayQrPageState extends State<PayThaiQr> {
|
|||||||
controller: price,
|
controller: price,
|
||||||
style: TextStyle(fontSize: 24),
|
style: TextStyle(fontSize: 24),
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
hintText: 'จำนวนเงินที่โอน',
|
hintText: "จำนวนเงินที่โอน / จ่าย".tr(),
|
||||||
border: InputBorder.none,
|
border: InputBorder.none,
|
||||||
contentPadding: EdgeInsets.symmetric(horizontal: 16),
|
contentPadding: EdgeInsets.symmetric(horizontal: 16),
|
||||||
),
|
),
|
||||||
@@ -178,7 +181,7 @@ class _PayQrPageState extends State<PayThaiQr> {
|
|||||||
height: 10,
|
height: 10,
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"ใช้แต้ม Cathay Pay แทนเงินสด",
|
"ใช้แต้ม NEO PAY แทนเงินสด".tr(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Color(0xff65676b),
|
color: Color(0xff65676b),
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
@@ -186,7 +189,7 @@ class _PayQrPageState extends State<PayThaiQr> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"คะแนนของคุณ : 12,000 แต้ม",
|
"${"คะแนนของคุณ".tr()} : 12,000 ${"แต้ม".tr()}",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Color(0xff9d001b),
|
color: Color(0xff9d001b),
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
@@ -211,7 +214,7 @@ class _PayQrPageState extends State<PayThaiQr> {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"0 แต้ม",
|
"10 ${"แต้ม".tr()}",
|
||||||
textAlign: TextAlign.right,
|
textAlign: TextAlign.right,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Color(0xff65676b),
|
color: Color(0xff65676b),
|
||||||
@@ -245,7 +248,7 @@ class _PayQrPageState extends State<PayThaiQr> {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"0 บาท",
|
"100 ${"Baht".tr()}",
|
||||||
textAlign: TextAlign.right,
|
textAlign: TextAlign.right,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
@@ -258,7 +261,7 @@ class _PayQrPageState extends State<PayThaiQr> {
|
|||||||
),
|
),
|
||||||
Center(
|
Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
"1 แต้ม = 10 สตางค์",
|
"1 แต้ม = 10 สตางค์".tr(),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Color(0xff65676b),
|
color: Color(0xff65676b),
|
||||||
@@ -278,7 +281,7 @@ class _PayQrPageState extends State<PayThaiQr> {
|
|||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"ยอดเงินทั้งหมด",
|
"ยอดเงินทั้งหมด".tr(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Color(0xff65676b),
|
color: Color(0xff65676b),
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
@@ -295,7 +298,7 @@ class _PayQrPageState extends State<PayThaiQr> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
" บาท",
|
" ${"Baht".tr()}",
|
||||||
textAlign: TextAlign.right,
|
textAlign: TextAlign.right,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Color(0xff65676b),
|
color: Color(0xff65676b),
|
||||||
@@ -318,36 +321,25 @@ class _PayQrPageState extends State<PayThaiQr> {
|
|||||||
initC2B();
|
initC2B();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Container(
|
child: SizedBox(
|
||||||
width: MediaQuery.of(context).size.width,
|
width: MediaQuery.of(context).size.width,
|
||||||
height: 51,
|
child: Card(
|
||||||
decoration: BoxDecoration(
|
color: Colors.white,
|
||||||
borderRadius: BorderRadius.circular(40),
|
shape: RoundedRectangleBorder(
|
||||||
color: Color(0xff9d001b),
|
borderRadius: BorderRadius.circular(40),
|
||||||
),
|
),
|
||||||
padding: const EdgeInsets.symmetric(
|
child: Container(
|
||||||
horizontal: 10,
|
padding: EdgeInsets.all(10),
|
||||||
vertical: 12,
|
child: Text(
|
||||||
),
|
"Confirm".tr(),
|
||||||
child: Row(
|
textAlign: TextAlign.center,
|
||||||
mainAxisSize: MainAxisSize.min,
|
style: GoogleFonts.kanit(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
color: ColorCustom.greyBorder,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
fontSize: 20,
|
||||||
children: [
|
fontWeight: FontWeight.w500,
|
||||||
SizedBox(
|
|
||||||
width: 106,
|
|
||||||
height: 32,
|
|
||||||
child: Text(
|
|
||||||
"ยืนยัน",
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: GoogleFonts.kanit(
|
|
||||||
color: Colors.white,
|
|
||||||
fontSize: 20,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
|
|
||||||
import '../api/api.dart';
|
import '../api/api.dart';
|
||||||
|
import '../utils/color_custom.dart';
|
||||||
import 'id_card_model.dart';
|
import 'id_card_model.dart';
|
||||||
|
|
||||||
List<CameraDescription> CameraApp = [];
|
List<CameraDescription> CameraApp = [];
|
||||||
@@ -177,20 +178,23 @@ class TakePictureScreenState extends State<CameraCardID> {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
child: Container(
|
child: SizedBox(
|
||||||
width: 150,
|
width: 150,
|
||||||
padding: EdgeInsets.all(5),
|
child: Card(
|
||||||
decoration: BoxDecoration(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(100),
|
borderRadius: BorderRadius.circular(40),
|
||||||
color: Color(0xff9d001b),
|
),
|
||||||
),
|
child: Container(
|
||||||
child: Text(
|
padding: EdgeInsets.all(10),
|
||||||
"Confirm".tr(),
|
child: Text(
|
||||||
textAlign: TextAlign.center,
|
"Confirm".tr(),
|
||||||
style: GoogleFonts.kanit(
|
textAlign: TextAlign.center,
|
||||||
color: Colors.white,
|
style: GoogleFonts.kanit(
|
||||||
fontSize: 20,
|
color: ColorCustom.greyBorder,
|
||||||
fontWeight: FontWeight.w500,
|
fontSize: 20,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
|
|
||||||
import '../api/api.dart';
|
import '../api/api.dart';
|
||||||
|
import '../utils/color_custom.dart';
|
||||||
import 'camera_card_id.dart';
|
import 'camera_card_id.dart';
|
||||||
import 'id_card_model.dart';
|
import 'id_card_model.dart';
|
||||||
|
|
||||||
@@ -154,20 +155,23 @@ class TakePictureScreenState extends State<CameraPassport> {
|
|||||||
postImagePath(File(imageFront));
|
postImagePath(File(imageFront));
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
child: Container(
|
child: SizedBox(
|
||||||
width: 150,
|
width: 150,
|
||||||
padding: EdgeInsets.all(5),
|
child: Card(
|
||||||
decoration: BoxDecoration(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(100),
|
borderRadius: BorderRadius.circular(40),
|
||||||
color: Color(0xff9d001b),
|
),
|
||||||
),
|
child: Container(
|
||||||
child: Text(
|
padding: EdgeInsets.all(10),
|
||||||
"Confirm".tr(),
|
child: Text(
|
||||||
textAlign: TextAlign.center,
|
"Confirm".tr(),
|
||||||
style: GoogleFonts.kanit(
|
textAlign: TextAlign.center,
|
||||||
color: Colors.white,
|
style: GoogleFonts.kanit(
|
||||||
fontSize: 20,
|
color: ColorCustom.greyBorder,
|
||||||
fontWeight: FontWeight.w500,
|
fontSize: 20,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import 'package:google_fonts/google_fonts.dart';
|
|||||||
import 'package:pin_code_fields/pin_code_fields.dart';
|
import 'package:pin_code_fields/pin_code_fields.dart';
|
||||||
|
|
||||||
import '../api/api.dart';
|
import '../api/api.dart';
|
||||||
|
import '../utils/color_custom.dart';
|
||||||
|
|
||||||
TextEditingController _textEditingController = TextEditingController();
|
TextEditingController _textEditingController = TextEditingController();
|
||||||
|
|
||||||
@@ -85,24 +86,29 @@ class _OtpPageState extends State<OtpPage> {
|
|||||||
// String otp = "";
|
// String otp = "";
|
||||||
String refno = "";
|
String refno = "";
|
||||||
String token = "";
|
String token = "";
|
||||||
|
String otpConfirm = "";
|
||||||
|
|
||||||
getOtp() async {
|
getOtp() async {
|
||||||
var param = jsonEncode(<dynamic, dynamic>{"key": Api.API_KEY, "secret": Api.API_SECRET, "msisdn": widget.phone});
|
var param = jsonEncode(<dynamic, dynamic>{"key": Api.API_KEY, "secret": Api.API_SECRET, "msisdn": widget.phone});
|
||||||
Api.postGetMessage(context, Api.otp, param).then((value) => {
|
Api.getRaw(context, Api.otpEmail + widget.email).then((value) => {
|
||||||
print(value),
|
print(value),
|
||||||
setState(() {
|
setState(() {
|
||||||
token = value["token"];
|
otpConfirm = value.toString();
|
||||||
refno = value["refno"];
|
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
verify(String otp) {
|
verify(String otp) {
|
||||||
var param = jsonEncode(<dynamic, dynamic>{"key": Api.API_KEY, "secret": Api.API_SECRET, "token": token, "pin": otp});
|
if (otp == otpConfirm) {
|
||||||
Api.postStatus(context, Api.verify, param).then((value) => {
|
Navigator.pushNamed(context, '/PolicyPage');
|
||||||
print(value),
|
} else {
|
||||||
if (value != null) {Navigator.pushNamed(context, '/PolicyPage')} else {Utils.showAlertDialog(context, "รหัส OTP ไม่ถูกต้อง")}
|
Utils.showAlertDialog(context, "รหัส OTP ไม่ถูกต้อง");
|
||||||
});
|
}
|
||||||
|
// var param = jsonEncode(<dynamic, dynamic>{"key": Api.API_KEY, "secret": Api.API_SECRET, "token": token, "pin": otp});
|
||||||
|
// Api.postStatus(context, Api.verify, param).then((value) => {
|
||||||
|
// print(value),
|
||||||
|
// if (value != null) {Navigator.pushNamed(context, '/PolicyPage')} else {Utils.showAlertDialog(context, "รหัส OTP ไม่ถูกต้อง")}
|
||||||
|
// });
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@@ -142,7 +148,7 @@ class _OtpPageState extends State<OtpPage> {
|
|||||||
padding: EdgeInsets.all(10),
|
padding: EdgeInsets.all(10),
|
||||||
child: Column(mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center, children: [
|
child: Column(mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center, children: [
|
||||||
Text(
|
Text(
|
||||||
"${"Please enter the OTP code.".tr()}\n${"The code will be sent to".tr()}${widget.phone}\nRef:$refno",
|
"${"Please enter the OTP code.".tr()}\n${"The code will be sent to".tr()}${widget.email}\nRef:$refno",
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: GoogleFonts.kanit(
|
style: GoogleFonts.kanit(
|
||||||
color: Color(0xff65676b),
|
color: Color(0xff65676b),
|
||||||
@@ -287,28 +293,24 @@ class _OtpPageState extends State<OtpPage> {
|
|||||||
onTap: () {
|
onTap: () {
|
||||||
verify(_textEditingController.text);
|
verify(_textEditingController.text);
|
||||||
},
|
},
|
||||||
child: Container(
|
child: SizedBox(
|
||||||
width: 374,
|
width: 374,
|
||||||
decoration: BoxDecoration(
|
child: Card(
|
||||||
borderRadius: BorderRadius.circular(100),
|
shape: RoundedRectangleBorder(
|
||||||
color: Color(0xff9d001b),
|
borderRadius: BorderRadius.circular(40),
|
||||||
),
|
),
|
||||||
padding: EdgeInsets.all(10),
|
child: Container(
|
||||||
child: Row(
|
padding: EdgeInsets.all(10),
|
||||||
mainAxisSize: MainAxisSize.min,
|
child: Text(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
"Confirm".tr(),
|
"Confirm".tr(),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: GoogleFonts.kanit(
|
style: GoogleFonts.kanit(
|
||||||
color: Colors.white,
|
color: ColorCustom.greyBorder,
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ class _PolicyPageState extends State<PolicyPage> {
|
|||||||
controller = WebViewController()
|
controller = WebViewController()
|
||||||
..setJavaScriptMode(JavaScriptMode.unrestricted)
|
..setJavaScriptMode(JavaScriptMode.unrestricted)
|
||||||
..setBackgroundColor(const Color(0x00000000))
|
..setBackgroundColor(const Color(0x00000000))
|
||||||
..loadRequest(Uri.parse('https://www.cathayinter.com/neo-travel-privacy-policy'));
|
..loadRequest(Uri.parse('https://neotravel.app/privacy-policy-neo-travel'));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
|
|||||||
@@ -5,6 +5,10 @@ import 'package:google_fonts/google_fonts.dart';
|
|||||||
|
|
||||||
import 'camera_passport.dart';
|
import 'camera_passport.dart';
|
||||||
|
|
||||||
|
|
||||||
|
var isPassport = false;
|
||||||
|
|
||||||
|
|
||||||
class PreRegisterPage extends StatefulWidget {
|
class PreRegisterPage extends StatefulWidget {
|
||||||
const PreRegisterPage({Key? key}) : super(key: key);
|
const PreRegisterPage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
@@ -67,6 +71,7 @@ class _LoginPageState extends State<PreRegisterPage> {
|
|||||||
),
|
),
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
|
isPassport = false;
|
||||||
Navigator.push(
|
Navigator.push(
|
||||||
context,
|
context,
|
||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
@@ -77,22 +82,11 @@ class _LoginPageState extends State<PreRegisterPage> {
|
|||||||
child: Container(
|
child: Container(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
margin: EdgeInsets.symmetric(horizontal: 30,vertical: 10),
|
margin: EdgeInsets.symmetric(horizontal: 30,vertical: 10),
|
||||||
child: Card(
|
child: context.locale.toString()=="th"?Image.asset("images/register/thaicard_th.png"):Image.asset("images/register/thaicard_en.png")
|
||||||
color: Colors.green.shade200,
|
|
||||||
child: Container(
|
|
||||||
alignment: Alignment.center,
|
|
||||||
padding: EdgeInsets.all(30),
|
|
||||||
child: Text(
|
|
||||||
"บัตรประชาชน".tr(),
|
|
||||||
style: GoogleFonts.kanit(
|
|
||||||
color: Colors.black,
|
|
||||||
fontSize: 22,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)),
|
|
||||||
)),
|
)),
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
|
isPassport = true;
|
||||||
Navigator.push(
|
Navigator.push(
|
||||||
context,
|
context,
|
||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
@@ -103,19 +97,7 @@ class _LoginPageState extends State<PreRegisterPage> {
|
|||||||
child: Container(
|
child: Container(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
margin: EdgeInsets.symmetric(horizontal: 30,vertical: 10),
|
margin: EdgeInsets.symmetric(horizontal: 30,vertical: 10),
|
||||||
child: Card(
|
child: context.locale.toString()=="th"?Image.asset("images/register/passport_th.png"):Image.asset("images/register/passport_en.png")
|
||||||
color: Colors.red.shade200,
|
|
||||||
child: Container(
|
|
||||||
alignment: Alignment.center,
|
|
||||||
padding: EdgeInsets.all(30),
|
|
||||||
child: Text(
|
|
||||||
"พาสปอร์ต".tr(),
|
|
||||||
style: GoogleFonts.kanit(
|
|
||||||
color: Colors.black,
|
|
||||||
fontSize: 22,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)),
|
|
||||||
)),
|
)),
|
||||||
SizedBox(height: 40,)
|
SizedBox(height: 40,)
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import 'package:cathaypay_mobile/Register/camera_card_id.dart';
|
import 'package:cathaypay_mobile/Register/camera_card_id.dart';
|
||||||
import 'package:cathaypay_mobile/Register/otp.dart';
|
import 'package:cathaypay_mobile/Register/otp.dart';
|
||||||
|
import 'package:cathaypay_mobile/Register/pre_register.dart';
|
||||||
import 'package:cathaypay_mobile/Register/register.dart';
|
import 'package:cathaypay_mobile/Register/register.dart';
|
||||||
import 'package:cathaypay_mobile/Register/register_occupation.dart';
|
import 'package:cathaypay_mobile/Register/register_occupation.dart';
|
||||||
import 'package:cathaypay_mobile/utils/utils.dart';
|
import 'package:cathaypay_mobile/utils/utils.dart';
|
||||||
@@ -10,6 +11,7 @@ import 'package:google_fonts/google_fonts.dart';
|
|||||||
import 'package:mask_text_input_formatter/mask_text_input_formatter.dart';
|
import 'package:mask_text_input_formatter/mask_text_input_formatter.dart';
|
||||||
|
|
||||||
import '../utils/calendar_picker.dart';
|
import '../utils/calendar_picker.dart';
|
||||||
|
import '../utils/color_custom.dart';
|
||||||
|
|
||||||
TextEditingController name = TextEditingController(text: idCardFront?.nameThai ?? "");
|
TextEditingController name = TextEditingController(text: idCardFront?.nameThai ?? "");
|
||||||
TextEditingController email = TextEditingController();
|
TextEditingController email = TextEditingController();
|
||||||
@@ -155,48 +157,50 @@ class _RegisterDataState extends State<RegisterData> {
|
|||||||
),*/
|
),*/
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
Padding(
|
isPassport?Container():Column(
|
||||||
padding: const EdgeInsets.fromLTRB(0, 10, 0, 10),
|
children: [
|
||||||
child: Container(
|
Padding(
|
||||||
width: MediaQuery.of(context).size.width,
|
padding: const EdgeInsets.fromLTRB(0, 10, 0, 10),
|
||||||
height: 1,
|
child: Container(
|
||||||
color: Color(0xfff3f3f3),
|
width: MediaQuery.of(context).size.width,
|
||||||
),
|
height: 1,
|
||||||
),
|
color: Color(0xfff3f3f3),
|
||||||
Row(
|
),
|
||||||
mainAxisSize: MainAxisSize.min,
|
),
|
||||||
children: [
|
Row(
|
||||||
Text(
|
mainAxisSize: MainAxisSize.min,
|
||||||
"Back of card number".tr(),
|
children: [
|
||||||
style: GoogleFonts.kanit(
|
Text(
|
||||||
color: Color(0xff565656),
|
"Back of card number".tr(),
|
||||||
fontSize: 15,
|
style: GoogleFonts.kanit(
|
||||||
),
|
color: Color(0xff565656),
|
||||||
),
|
fontSize: 15,
|
||||||
Expanded(
|
),
|
||||||
child: TextField(
|
),
|
||||||
style: GoogleFonts.kanit(
|
Expanded(
|
||||||
color: Color(0xff565656),
|
child: TextField(
|
||||||
fontSize: 15,
|
style: GoogleFonts.kanit(
|
||||||
),
|
color: Color(0xff565656),
|
||||||
inputFormatters: <TextInputFormatter>[maskFormatter],
|
fontSize: 15,
|
||||||
maxLength: 15,
|
),
|
||||||
keyboardType: TextInputType.text,
|
inputFormatters: <TextInputFormatter>[maskFormatter],
|
||||||
textAlign: TextAlign.right,
|
maxLength: 15,
|
||||||
controller: idCardBackEditText,
|
keyboardType: TextInputType.text,
|
||||||
decoration: InputDecoration(
|
textAlign: TextAlign.right,
|
||||||
counterText: "",
|
controller: idCardBackEditText,
|
||||||
hintText: '',
|
decoration: InputDecoration(
|
||||||
suffixIcon: Icon(
|
counterText: "",
|
||||||
Icons.arrow_forward_ios_rounded,
|
hintText: '',
|
||||||
size: 15,
|
suffixIcon: Icon(
|
||||||
color: Colors.grey,
|
Icons.arrow_forward_ios_rounded,
|
||||||
),
|
size: 15,
|
||||||
border: InputBorder.none,
|
color: Colors.grey,
|
||||||
),
|
),
|
||||||
),
|
border: InputBorder.none,
|
||||||
),
|
),
|
||||||
/*Expanded(
|
),
|
||||||
|
),
|
||||||
|
/*Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
idCardBack?.nameThai ?? "",
|
idCardBack?.nameThai ?? "",
|
||||||
textAlign: TextAlign.right,
|
textAlign: TextAlign.right,
|
||||||
@@ -207,8 +211,10 @@ class _RegisterDataState extends State<RegisterData> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),*/
|
),*/
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
/*Padding(
|
/*Padding(
|
||||||
padding: const EdgeInsets.fromLTRB(0, 10, 0, 10),
|
padding: const EdgeInsets.fromLTRB(0, 10, 0, 10),
|
||||||
child: Container(
|
child: Container(
|
||||||
@@ -1201,21 +1207,22 @@ class _RegisterDataState extends State<RegisterData> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
child: Container(
|
child: SizedBox(
|
||||||
width: 374,
|
width: 374,
|
||||||
height: 56,
|
child: Card(
|
||||||
decoration: BoxDecoration(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(100),
|
borderRadius: BorderRadius.circular(40),
|
||||||
color: Color(0xff9d001b),
|
),
|
||||||
),
|
child: Container(
|
||||||
child: Center(
|
padding: EdgeInsets.all(10),
|
||||||
child: Text(
|
child: Text(
|
||||||
"Next".tr(),
|
"Next".tr(),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: GoogleFonts.kanit(
|
style: GoogleFonts.kanit(
|
||||||
color: Colors.white,
|
color: ColorCustom.greyBorder,
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import 'package:google_fonts/google_fonts.dart';
|
|||||||
import 'package:image_picker/image_picker.dart';
|
import 'package:image_picker/image_picker.dart';
|
||||||
|
|
||||||
import '../api/api.dart';
|
import '../api/api.dart';
|
||||||
|
import '../utils/color_custom.dart';
|
||||||
|
|
||||||
String imageEkycPath = "";
|
String imageEkycPath = "";
|
||||||
|
|
||||||
@@ -165,19 +166,23 @@ class _RegisterPicturePageState extends State<RegisterPicturePage> {
|
|||||||
onTap: () {
|
onTap: () {
|
||||||
_imageFile != null ? Navigator.pushNamed(context, '/RegisterSignaturePage') : Navigator.pushNamed(context, '/RegisterSignaturePage');
|
_imageFile != null ? Navigator.pushNamed(context, '/RegisterSignaturePage') : Navigator.pushNamed(context, '/RegisterSignaturePage');
|
||||||
},
|
},
|
||||||
child: Container(
|
child: SizedBox(
|
||||||
decoration: BoxDecoration(
|
width: double.infinity,
|
||||||
borderRadius: BorderRadius.circular(100),
|
child: Card(
|
||||||
color: Color(0xff9d001b),
|
shape: RoundedRectangleBorder(
|
||||||
),
|
borderRadius: BorderRadius.circular(40),
|
||||||
padding: EdgeInsets.all(10),
|
),
|
||||||
child: Text(
|
child: Container(
|
||||||
"Next".tr(),
|
padding: EdgeInsets.all(10),
|
||||||
textAlign: TextAlign.center,
|
child: Text(
|
||||||
style: GoogleFonts.kanit(
|
"Next".tr(),
|
||||||
color: Colors.white,
|
textAlign: TextAlign.center,
|
||||||
fontSize: 20,
|
style: GoogleFonts.kanit(
|
||||||
fontWeight: FontWeight.w500,
|
color: ColorCustom.greyBorder,
|
||||||
|
fontSize: 20,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import 'package:path_provider/path_provider.dart';
|
|||||||
import 'package:signature/signature.dart';
|
import 'package:signature/signature.dart';
|
||||||
|
|
||||||
import '../api/api.dart';
|
import '../api/api.dart';
|
||||||
|
import '../utils/color_custom.dart';
|
||||||
|
|
||||||
class RegisterSignaturePage extends StatefulWidget {
|
class RegisterSignaturePage extends StatefulWidget {
|
||||||
const RegisterSignaturePage({Key? key}) : super(key: key);
|
const RegisterSignaturePage({Key? key}) : super(key: key);
|
||||||
@@ -62,7 +63,7 @@ class _RegisterSignaturePageState extends State<RegisterSignaturePage> {
|
|||||||
"Password": password.text,
|
"Password": password.text,
|
||||||
"ConfirmPassword": passwordConfirm.text,
|
"ConfirmPassword": passwordConfirm.text,
|
||||||
"MobileDeviceId": deviceId,
|
"MobileDeviceId": deviceId,
|
||||||
"PersonalCardId": idCardFront?.idCard,
|
"PersonalCardId": idCardEditText.text,
|
||||||
"MaxCardID": phone.text,
|
"MaxCardID": phone.text,
|
||||||
"UserType": "P",
|
"UserType": "P",
|
||||||
"CustomerTypeId": "P01",
|
"CustomerTypeId": "P01",
|
||||||
@@ -229,21 +230,23 @@ class _RegisterSignaturePageState extends State<RegisterSignaturePage> {
|
|||||||
onTap: () async {
|
onTap: () async {
|
||||||
signatureCapture();
|
signatureCapture();
|
||||||
},
|
},
|
||||||
child: Container(
|
child: SizedBox(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
margin: EdgeInsets.only(left: 20, right: 20, bottom: 20, top: 20),
|
child: Card(
|
||||||
decoration: BoxDecoration(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(100),
|
borderRadius: BorderRadius.circular(40),
|
||||||
color: Color(0xff9d001b),
|
),
|
||||||
),
|
child: Container(
|
||||||
padding: EdgeInsets.all(10),
|
padding: EdgeInsets.all(10),
|
||||||
child: Text(
|
child: Text(
|
||||||
"Next".tr(),
|
"Next".tr(),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: GoogleFonts.kanit(
|
style: GoogleFonts.kanit(
|
||||||
color: Colors.white,
|
color: ColorCustom.greyBorder,
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -444,7 +444,7 @@ class _TopUpHistoryState extends State<TopUpHistory> {
|
|||||||
"invoiceId": "",
|
"invoiceId": "",
|
||||||
"referencE1": "",
|
"referencE1": "",
|
||||||
"referencE2": "",
|
"referencE2": "",
|
||||||
"topupStatus": "WALLETADDED",
|
"paymentStatus": "WALLETADDED",
|
||||||
"paymentChannel": "",
|
"paymentChannel": "",
|
||||||
"createDatefrom": end,
|
"createDatefrom": end,
|
||||||
"createDateto": start,
|
"createDateto": start,
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import 'package:easy_localization/easy_localization.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:image_gallery_saver/image_gallery_saver.dart';
|
import 'package:saver_gallery/saver_gallery.dart';
|
||||||
import 'package:screenshot/screenshot.dart';
|
import 'package:screenshot/screenshot.dart';
|
||||||
|
|
||||||
import '../Home/HomePage.dart';
|
import '../Home/HomePage.dart';
|
||||||
@@ -65,7 +65,9 @@ class _TransferPromptPayDetailState extends State<TopUpAmountPage> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
saveQrCode() {
|
saveQrCode() {
|
||||||
ImageGallerySaver.saveImage(base64Decode(myQrCode ?? ""));
|
// ImageGallerySaver.saveImage(base64Decode(myQrCode ?? ""));
|
||||||
|
String fileName = "neopay_${DateTime.now().millisecondsSinceEpoch}.jpg";
|
||||||
|
SaverGallery.saveImage(base64Decode(myQrCode ?? ""), fileName: fileName, skipIfExists: false);
|
||||||
Utils.showAlertDialogCallback(
|
Utils.showAlertDialogCallback(
|
||||||
context,
|
context,
|
||||||
"บันทึกสำเร็จ",
|
"บันทึกสำเร็จ",
|
||||||
@@ -80,7 +82,9 @@ class _TransferPromptPayDetailState extends State<TopUpAmountPage> {
|
|||||||
captureQrCode() {
|
captureQrCode() {
|
||||||
screenshotController.capture().then((Uint8List? image) {
|
screenshotController.capture().then((Uint8List? image) {
|
||||||
if (image != null) {
|
if (image != null) {
|
||||||
ImageGallerySaver.saveImage(image);
|
// ImageGallerySaver.saveImage(image);
|
||||||
|
String fileName = "neopay_${DateTime.now().millisecondsSinceEpoch}.jpg";
|
||||||
|
SaverGallery.saveImage(image, fileName: fileName, skipIfExists: false);
|
||||||
Utils.showAlertDialogCallback(
|
Utils.showAlertDialogCallback(
|
||||||
context,
|
context,
|
||||||
"บันทึกสำเร็จ",
|
"บันทึกสำเร็จ",
|
||||||
@@ -253,75 +257,86 @@ class _TransferPromptPayDetailState extends State<TopUpAmountPage> {
|
|||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
children: [
|
children: [
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
},
|
},
|
||||||
child: Container(
|
child: SizedBox(
|
||||||
margin: EdgeInsets.only(bottom: 15),
|
width: MediaQuery.of(context).size.width / 3,
|
||||||
width: MediaQuery.of(context).size.width / 3.5,
|
child: Card(
|
||||||
height: 46,
|
color: Color(0xff2d2d2d),
|
||||||
decoration: BoxDecoration(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(100),
|
borderRadius: BorderRadius.circular(40),
|
||||||
color: Color(0xff2d2d2d),
|
|
||||||
),
|
),
|
||||||
child: Center(
|
child: Container(
|
||||||
child: Text(
|
padding: EdgeInsets.all(10),
|
||||||
"ยกเลิก",
|
child: Text(
|
||||||
textAlign: TextAlign.center,
|
"ยกเลิก".tr(),
|
||||||
style: TextStyle(
|
maxLines: 1,
|
||||||
color: Colors.white,
|
textAlign: TextAlign.center,
|
||||||
fontSize: 16,
|
style: GoogleFonts.kanit(
|
||||||
fontWeight: FontWeight.w300,
|
color: ColorCustom.white,
|
||||||
|
fontSize: 14,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
)),
|
),
|
||||||
)),
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Navigator.pushNamed(context, '/HomePage');
|
Navigator.pushNamed(context, '/HomePage');
|
||||||
},
|
},
|
||||||
child: Container(
|
child: SizedBox(
|
||||||
margin: EdgeInsets.only(bottom: 15),
|
width: MediaQuery.of(context).size.width / 3,
|
||||||
width: MediaQuery.of(context).size.width / 3.5,
|
child: Card(
|
||||||
height: 46,
|
color: Colors.white,
|
||||||
decoration: BoxDecoration(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(100),
|
borderRadius: BorderRadius.circular(40),
|
||||||
color: Color(0xffad022c),
|
|
||||||
),
|
),
|
||||||
child: Center(
|
child: Container(
|
||||||
child: Text(
|
padding: EdgeInsets.all(10),
|
||||||
"กลับสู่หน้าหลัก",
|
child: Text(
|
||||||
textAlign: TextAlign.center,
|
"กลับสู่หน้าหลัก".tr(),
|
||||||
style: TextStyle(
|
maxLines: 1,
|
||||||
color: Colors.white,
|
textAlign: TextAlign.center,
|
||||||
fontSize: 16,
|
style: GoogleFonts.kanit(
|
||||||
fontWeight: FontWeight.w300,
|
color: ColorCustom.greyBorder,
|
||||||
|
fontSize: 14,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
)),
|
),
|
||||||
)),
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
// saveQrCode();
|
// saveQrCode();
|
||||||
captureQrCode();
|
captureQrCode();
|
||||||
},
|
},
|
||||||
child: Container(
|
child: SizedBox(
|
||||||
margin: EdgeInsets.only(bottom: 15),
|
width: MediaQuery.of(context).size.width / 3,
|
||||||
width: MediaQuery.of(context).size.width / 3.5,
|
child: Card(
|
||||||
height: 46,
|
color: Colors.white,
|
||||||
decoration: BoxDecoration(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(100),
|
borderRadius: BorderRadius.circular(40),
|
||||||
color: Color(0xffad022c),
|
|
||||||
),
|
),
|
||||||
child: Center(
|
child: Container(
|
||||||
child: Text(
|
padding: EdgeInsets.all(10),
|
||||||
"บันทึก QR",
|
child: Text(
|
||||||
textAlign: TextAlign.center,
|
"Save QR".tr(),
|
||||||
style: TextStyle(
|
textAlign: TextAlign.center,
|
||||||
color: Colors.white,
|
style: GoogleFonts.kanit(
|
||||||
fontSize: 16,
|
color: ColorCustom.greyBorder,
|
||||||
fontWeight: FontWeight.w300,
|
fontSize: 14,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
)),
|
),
|
||||||
)),
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
@@ -486,36 +501,25 @@ class _TransferPromptPayDetailState extends State<TopUpAmountPage> {
|
|||||||
onTap: () async {
|
onTap: () async {
|
||||||
initTopUp();
|
initTopUp();
|
||||||
},
|
},
|
||||||
child: Container(
|
child: SizedBox(
|
||||||
width: MediaQuery.of(context).size.width,
|
width: double.infinity,
|
||||||
height: 51,
|
child: Card(
|
||||||
decoration: BoxDecoration(
|
color: Colors.white,
|
||||||
borderRadius: BorderRadius.circular(40),
|
shape: RoundedRectangleBorder(
|
||||||
color: Color(0xff9d001b),
|
borderRadius: BorderRadius.circular(40),
|
||||||
),
|
),
|
||||||
padding: const EdgeInsets.symmetric(
|
child: Container(
|
||||||
horizontal: 10,
|
padding: EdgeInsets.all(10),
|
||||||
vertical: 12,
|
child: Text(
|
||||||
),
|
"Create QR code".tr(),
|
||||||
child: Row(
|
textAlign: TextAlign.center,
|
||||||
mainAxisSize: MainAxisSize.min,
|
style: GoogleFonts.kanit(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
color: ColorCustom.greyBorder,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
fontSize: 20,
|
||||||
children: [
|
fontWeight: FontWeight.w500,
|
||||||
SizedBox(
|
|
||||||
width: 106,
|
|
||||||
height: 32,
|
|
||||||
child: Text(
|
|
||||||
"Create QR code".tr(),
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: GoogleFonts.kanit(
|
|
||||||
color: Colors.white,
|
|
||||||
fontSize: 20,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -6,12 +6,11 @@ import 'package:easy_localization/easy_localization.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:image_gallery_saver/image_gallery_saver.dart';
|
|
||||||
import 'package:qr_flutter/qr_flutter.dart';
|
import 'package:qr_flutter/qr_flutter.dart';
|
||||||
|
import 'package:saver_gallery/saver_gallery.dart';
|
||||||
import 'package:screenshot/screenshot.dart';
|
import 'package:screenshot/screenshot.dart';
|
||||||
|
|
||||||
import '../Home/HomePage.dart';
|
import '../Home/HomePage.dart';
|
||||||
import '../Numpad.dart';
|
|
||||||
import '../api/api.dart';
|
import '../api/api.dart';
|
||||||
import '../model/qrcode.dart';
|
import '../model/qrcode.dart';
|
||||||
|
|
||||||
@@ -25,28 +24,30 @@ class TopUpMyQrPage extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _TransferPromptPayDetailState extends State<TopUpMyQrPage> {
|
class _TransferPromptPayDetailState extends State<TopUpMyQrPage> {
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
initMyQr();
|
initMyQr();
|
||||||
super.initState();
|
super.initState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool loading = false;
|
bool loading = false;
|
||||||
|
|
||||||
QrCodeModel? myQrCode;
|
QrCodeModel? myQrCode;
|
||||||
|
|
||||||
initMyQr() {
|
initMyQr() {
|
||||||
var param = jsonEncode(<dynamic, dynamic>{"MobileDeviceNo": profile?.phoneNumber ?? "", "Note": "myQr",});
|
var param = jsonEncode(<dynamic, dynamic>{
|
||||||
Api.post(context, Api.myQrCode, param).then((value) => {
|
"MobileDeviceNo": profile?.phoneNumber ?? "",
|
||||||
if (value != null) {initQrCode(value)} else {}
|
"Note": "myQr",
|
||||||
});
|
});
|
||||||
|
Api.post(context, Api.myQrCode, param).then((value) => {
|
||||||
|
if (value != null) {initQrCode(value)} else {}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
saveQrCode() {
|
saveQrCode() {
|
||||||
ImageGallerySaver.saveImage(base64Decode(myQrCode?.qrCodeData ?? ""));
|
// ImageGallerySaver.saveImage(base64Decode(myQrCode?.qrCodeData ?? ""));
|
||||||
|
String fileName = "neopay_${DateTime.now().millisecondsSinceEpoch}.jpg";
|
||||||
|
SaverGallery.saveImage(base64Decode(myQrCode?.qrCodeData ?? ""), fileName: fileName, skipIfExists: false);
|
||||||
Utils.showAlertDialogCallback(
|
Utils.showAlertDialogCallback(
|
||||||
context,
|
context,
|
||||||
"บันทึกสำเร็จ",
|
"บันทึกสำเร็จ",
|
||||||
@@ -56,13 +57,14 @@ class _TransferPromptPayDetailState extends State<TopUpMyQrPage> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ScreenshotController screenshotController = ScreenshotController();
|
ScreenshotController screenshotController = ScreenshotController();
|
||||||
|
|
||||||
captureQrCode() {
|
captureQrCode() {
|
||||||
screenshotController.capture().then((Uint8List? image) {
|
screenshotController.capture().then((Uint8List? image) {
|
||||||
if (image != null) {
|
if (image != null) {
|
||||||
ImageGallerySaver.saveImage(image);
|
// ImageGallerySaver.saveImage(image);
|
||||||
|
String fileName = "neopay_${DateTime.now().millisecondsSinceEpoch}.jpg";
|
||||||
|
SaverGallery.saveImage(image, fileName: fileName, skipIfExists: false);
|
||||||
Utils.showAlertDialogCallback(
|
Utils.showAlertDialogCallback(
|
||||||
context,
|
context,
|
||||||
"บันทึกสำเร็จ",
|
"บันทึกสำเร็จ",
|
||||||
@@ -366,10 +368,7 @@ class _TransferPromptPayDetailState extends State<TopUpMyQrPage> {
|
|||||||
child: Screenshot(
|
child: Screenshot(
|
||||||
controller: screenshotController,
|
controller: screenshotController,
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(border: Border.all(width: 1.0, color: Colors.grey), color: Colors.white),
|
||||||
border: Border.all(width: 1.0, color: Colors.grey),
|
|
||||||
color: Colors.white
|
|
||||||
),
|
|
||||||
padding: EdgeInsets.all(20),
|
padding: EdgeInsets.all(20),
|
||||||
margin: EdgeInsets.all(20),
|
margin: EdgeInsets.all(20),
|
||||||
child: Column(
|
child: Column(
|
||||||
@@ -459,83 +458,97 @@ class _TransferPromptPayDetailState extends State<TopUpMyQrPage> {
|
|||||||
),
|
),
|
||||||
))),
|
))),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 20,
|
height: 10,
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
children: [
|
children: [
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Navigator.of(context).pop();
|
Navigator.pushNamed(context, '/HomePage');
|
||||||
},
|
},
|
||||||
child: Container(
|
child: SizedBox(
|
||||||
margin: EdgeInsets.only(bottom: 15),
|
width: MediaQuery.of(context).size.width / 3,
|
||||||
width: MediaQuery.of(context).size.width / 3.5,
|
child: Card(
|
||||||
height: 46,
|
color: Colors.white,
|
||||||
decoration: BoxDecoration(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(100),
|
borderRadius: BorderRadius.circular(40),
|
||||||
color: Color(0xff2d2d2d),
|
|
||||||
),
|
),
|
||||||
child: Center(
|
child: Container(
|
||||||
child: Text(
|
padding: EdgeInsets.all(10),
|
||||||
"ยกเลิก",
|
child: Text(
|
||||||
textAlign: TextAlign.center,
|
"กลับสู่หน้าหลัก".tr(),
|
||||||
style: TextStyle(
|
maxLines: 1,
|
||||||
color: Colors.white,
|
textAlign: TextAlign.center,
|
||||||
fontSize: 16,
|
style: GoogleFonts.kanit(
|
||||||
fontWeight: FontWeight.w300,
|
color: ColorCustom.greyBorder,
|
||||||
),
|
fontSize: 14,
|
||||||
)),
|
fontWeight: FontWeight.w500,
|
||||||
)),
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Navigator.pushNamed(context, '/HomePage');
|
// saveQrCode();
|
||||||
},
|
captureQrCode();
|
||||||
child: Container(
|
},
|
||||||
margin: EdgeInsets.only(bottom: 15),
|
child: SizedBox(
|
||||||
width: MediaQuery.of(context).size.width / 3.5,
|
width: MediaQuery.of(context).size.width / 3,
|
||||||
height: 46,
|
child: Card(
|
||||||
decoration: BoxDecoration(
|
color: Colors.white,
|
||||||
borderRadius: BorderRadius.circular(100),
|
shape: RoundedRectangleBorder(
|
||||||
color: Color(0xffad022c),
|
borderRadius: BorderRadius.circular(40),
|
||||||
),
|
),
|
||||||
child: Center(
|
child: Container(
|
||||||
child: Text(
|
padding: EdgeInsets.all(10),
|
||||||
"กลับสู่หน้าหลัก",
|
child: Text(
|
||||||
textAlign: TextAlign.center,
|
"Save QR".tr(),
|
||||||
style: TextStyle(
|
textAlign: TextAlign.center,
|
||||||
color: Colors.white,
|
style: GoogleFonts.kanit(
|
||||||
fontSize: 16,
|
color: ColorCustom.greyBorder,
|
||||||
fontWeight: FontWeight.w300,
|
fontSize: 14,
|
||||||
),
|
fontWeight: FontWeight.w500,
|
||||||
)),
|
),
|
||||||
)),
|
),
|
||||||
InkWell(
|
|
||||||
onTap: () {
|
|
||||||
// saveQrCode();
|
|
||||||
captureQrCode();
|
|
||||||
},
|
|
||||||
child: Container(
|
|
||||||
margin: EdgeInsets.only(bottom: 15),
|
|
||||||
width: MediaQuery.of(context).size.width / 3.5,
|
|
||||||
height: 46,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
borderRadius: BorderRadius.circular(100),
|
|
||||||
color: Color(0xffad022c),
|
|
||||||
),
|
),
|
||||||
child: Center(
|
),
|
||||||
child: Text(
|
),
|
||||||
"บันทึก QR",
|
),
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: TextStyle(
|
|
||||||
color: Colors.white,
|
|
||||||
fontSize: 16,
|
|
||||||
fontWeight: FontWeight.w300,
|
|
||||||
),
|
|
||||||
)),
|
|
||||||
)),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
InkWell(
|
||||||
|
onTap: () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
},
|
||||||
|
child: SizedBox(
|
||||||
|
width: MediaQuery.of(context).size.width / 2,
|
||||||
|
child: Card(
|
||||||
|
color: Color(0xff2d2d2d),
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(40),
|
||||||
|
),
|
||||||
|
child: Container(
|
||||||
|
padding: EdgeInsets.all(10),
|
||||||
|
child: Text(
|
||||||
|
"ยกเลิก".tr(),
|
||||||
|
maxLines: 1,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: GoogleFonts.kanit(
|
||||||
|
color: ColorCustom.white,
|
||||||
|
fontSize: 14,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 20,
|
height: 20,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
|
|
||||||
import '../PinCodeVadidate.dart';
|
import '../PinCodeVadidate.dart';
|
||||||
|
import '../utils/color_custom.dart';
|
||||||
import 'TransferCathayPayDialog.dart';
|
import 'TransferCathayPayDialog.dart';
|
||||||
|
|
||||||
class TransferCathayPay extends StatefulWidget {
|
class TransferCathayPay extends StatefulWidget {
|
||||||
@@ -18,7 +20,7 @@ class _TransferCathayPayState extends State<TransferCathayPay> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return Scaffold(body: SingleChildScrollView(
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
@@ -32,7 +34,7 @@ class _TransferCathayPayState extends State<TransferCathayPay> {
|
|||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
)),
|
)),
|
||||||
Text(
|
Text(
|
||||||
"โอนเงินให้สมาชิก NEO PAY",
|
"โอนเงินให้สมาชิก NEO PAY".tr(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Color(0xff050505),
|
color: Color(0xff050505),
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
@@ -40,7 +42,7 @@ class _TransferCathayPayState extends State<TransferCathayPay> {
|
|||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
Spacer(),
|
SizedBox(height: 20,),
|
||||||
Container(
|
Container(
|
||||||
child: TextField(
|
child: TextField(
|
||||||
keyboardType: TextInputType.number,
|
keyboardType: TextInputType.number,
|
||||||
@@ -49,7 +51,7 @@ class _TransferCathayPayState extends State<TransferCathayPay> {
|
|||||||
],
|
],
|
||||||
controller: _phone,
|
controller: _phone,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
hintText: 'เบอร์โทรศัพท์ผู้รับ',
|
hintText: 'เบอร์โทรศัพท์ผู้รับ'.tr(),
|
||||||
border: InputBorder.none,
|
border: InputBorder.none,
|
||||||
contentPadding: EdgeInsets.symmetric(horizontal: 16),
|
contentPadding: EdgeInsets.symmetric(horizontal: 16),
|
||||||
),
|
),
|
||||||
@@ -61,7 +63,7 @@ class _TransferCathayPayState extends State<TransferCathayPay> {
|
|||||||
color: Color(0xfff2f2f2),
|
color: Color(0xfff2f2f2),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Spacer(),
|
SizedBox(height: 20,),
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
showModalBottomSheet<void>(
|
showModalBottomSheet<void>(
|
||||||
@@ -78,36 +80,24 @@ class _TransferCathayPayState extends State<TransferCathayPay> {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
margin: EdgeInsets.only(left: 20, right: 20),
|
width: double.infinity,
|
||||||
width: MediaQuery.of(context).size.width,
|
margin: const EdgeInsets.symmetric(horizontal: 15),
|
||||||
height: 51,
|
child: Card(
|
||||||
decoration: BoxDecoration(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(40),
|
borderRadius: BorderRadius.circular(40),
|
||||||
color: Color(0xff9d001b),
|
),
|
||||||
),
|
child: Container(
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: EdgeInsets.all(10),
|
||||||
horizontal: 10,
|
child: Text(
|
||||||
vertical: 12,
|
"Next".tr(),
|
||||||
),
|
textAlign: TextAlign.center,
|
||||||
child: Row(
|
style: GoogleFonts.kanit(
|
||||||
mainAxisSize: MainAxisSize.min,
|
color: ColorCustom.greyBorder,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
fontSize: 20,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
fontWeight: FontWeight.w500,
|
||||||
children: [
|
|
||||||
SizedBox(
|
|
||||||
width: 106,
|
|
||||||
height: 32,
|
|
||||||
child: Text(
|
|
||||||
"ต่อไป",
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: GoogleFonts.kanit(
|
|
||||||
color: Colors.white,
|
|
||||||
fontSize: 20,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -116,7 +106,7 @@ class _TransferCathayPayState extends State<TransferCathayPay> {
|
|||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
),);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -151,7 +141,7 @@ class _TransferCathayPayDetailState extends State<TransferCathayPayDetail> {
|
|||||||
],
|
],
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
title: Text(
|
title: Text(
|
||||||
"โอนเงิน",
|
"Transfer Money".tr(),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: GoogleFonts.kanit(
|
style: GoogleFonts.kanit(
|
||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
@@ -168,7 +158,7 @@ class _TransferCathayPayDetailState extends State<TransferCathayPayDetail> {
|
|||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"ชื่อ",
|
"ชื่อ".tr(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Color(0xff65676b),
|
color: Color(0xff65676b),
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
@@ -188,7 +178,7 @@ class _TransferCathayPayDetailState extends State<TransferCathayPayDetail> {
|
|||||||
children: [
|
children: [
|
||||||
Spacer(),
|
Spacer(),
|
||||||
Text(
|
Text(
|
||||||
"กมลรวี กอสัมพันธ์",
|
"",
|
||||||
textAlign: TextAlign.right,
|
textAlign: TextAlign.right,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Color(0xff65676b),
|
color: Color(0xff65676b),
|
||||||
@@ -207,7 +197,7 @@ class _TransferCathayPayDetailState extends State<TransferCathayPayDetail> {
|
|||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"เบอร์โทรศัพท์",
|
"เบอร์โทรศัพท์".tr(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Color(0xff65676b),
|
color: Color(0xff65676b),
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
@@ -216,7 +206,7 @@ class _TransferCathayPayDetailState extends State<TransferCathayPayDetail> {
|
|||||||
),
|
),
|
||||||
Spacer(),
|
Spacer(),
|
||||||
Text(
|
Text(
|
||||||
"089 - 108 - 0891",
|
"",
|
||||||
textAlign: TextAlign.right,
|
textAlign: TextAlign.right,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Color(0xff65676b),
|
color: Color(0xff65676b),
|
||||||
@@ -229,7 +219,7 @@ class _TransferCathayPayDetailState extends State<TransferCathayPayDetail> {
|
|||||||
height: 10,
|
height: 10,
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"จำนวนเงินที่โอน / จ่าย",
|
"จำนวนเงินที่โอน / จ่าย".tr(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Color(0xff65676b),
|
color: Color(0xff65676b),
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
@@ -249,7 +239,7 @@ class _TransferCathayPayDetailState extends State<TransferCathayPayDetail> {
|
|||||||
children: [
|
children: [
|
||||||
Spacer(),
|
Spacer(),
|
||||||
Text(
|
Text(
|
||||||
"5,000.00",
|
"",
|
||||||
textAlign: TextAlign.right,
|
textAlign: TextAlign.right,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Color(0xff65676b),
|
color: Color(0xff65676b),
|
||||||
@@ -266,7 +256,7 @@ class _TransferCathayPayDetailState extends State<TransferCathayPayDetail> {
|
|||||||
height: 10,
|
height: 10,
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"ใช้แต้ม NEO PAY แทนเงินสด",
|
"ใช้แต้ม NEO PAY แทนเงินสด".tr(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Color(0xff65676b),
|
color: Color(0xff65676b),
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
@@ -274,7 +264,7 @@ class _TransferCathayPayDetailState extends State<TransferCathayPayDetail> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"คะแนนของคุณ : 12,000 แต้ม",
|
"${"คะแนนของคุณ".tr()} : 12,000 ${"แต้ม".tr()}",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Color(0xff9d001b),
|
color: Color(0xff9d001b),
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
@@ -284,7 +274,6 @@ class _TransferCathayPayDetailState extends State<TransferCathayPayDetail> {
|
|||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
width: 161,
|
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(100),
|
borderRadius: BorderRadius.circular(100),
|
||||||
color: Color(0xfff2f2f2),
|
color: Color(0xfff2f2f2),
|
||||||
@@ -299,7 +288,7 @@ class _TransferCathayPayDetailState extends State<TransferCathayPayDetail> {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"10 แต้ม",
|
"10 ${"แต้ม".tr()}",
|
||||||
textAlign: TextAlign.right,
|
textAlign: TextAlign.right,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Color(0xff65676b),
|
color: Color(0xff65676b),
|
||||||
@@ -332,7 +321,7 @@ class _TransferCathayPayDetailState extends State<TransferCathayPayDetail> {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"100 บาท",
|
"100 ${"Baht".tr()}",
|
||||||
textAlign: TextAlign.right,
|
textAlign: TextAlign.right,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
@@ -345,7 +334,7 @@ class _TransferCathayPayDetailState extends State<TransferCathayPayDetail> {
|
|||||||
),
|
),
|
||||||
Center(
|
Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
"1 แต้ม = 10 สตางค์",
|
"1 แต้ม = 10 สตางค์".tr(),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Color(0xff65676b),
|
color: Color(0xff65676b),
|
||||||
@@ -355,6 +344,8 @@ class _TransferCathayPayDetailState extends State<TransferCathayPayDetail> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
|
height: 136,
|
||||||
|
color: Colors.transparent,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
SizedBox(
|
||||||
@@ -363,7 +354,7 @@ class _TransferCathayPayDetailState extends State<TransferCathayPayDetail> {
|
|||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"ยอดเงินทั้งหมด",
|
"ยอดเงินทั้งหมด".tr(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Color(0xff65676b),
|
color: Color(0xff65676b),
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
@@ -371,7 +362,7 @@ class _TransferCathayPayDetailState extends State<TransferCathayPayDetail> {
|
|||||||
),
|
),
|
||||||
Spacer(),
|
Spacer(),
|
||||||
Text(
|
Text(
|
||||||
"4.990.00",
|
"",
|
||||||
textAlign: TextAlign.right,
|
textAlign: TextAlign.right,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Color(0xff9d001b),
|
color: Color(0xff9d001b),
|
||||||
@@ -380,7 +371,7 @@ class _TransferCathayPayDetailState extends State<TransferCathayPayDetail> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
" บาท",
|
" ${"Baht".tr()}",
|
||||||
textAlign: TextAlign.right,
|
textAlign: TextAlign.right,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Color(0xff65676b),
|
color: Color(0xff65676b),
|
||||||
@@ -406,36 +397,24 @@ class _TransferCathayPayDetailState extends State<TransferCathayPayDetail> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Container(
|
child: SizedBox(
|
||||||
width: MediaQuery.of(context).size.width,
|
width: double.infinity,
|
||||||
height: 51,
|
child: Card(
|
||||||
decoration: BoxDecoration(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(40),
|
borderRadius: BorderRadius.circular(40),
|
||||||
color: Color(0xff9d001b),
|
),
|
||||||
),
|
child: Container(
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: EdgeInsets.all(10),
|
||||||
horizontal: 10,
|
child: Text(
|
||||||
vertical: 12,
|
"Confirm".tr(),
|
||||||
),
|
textAlign: TextAlign.center,
|
||||||
child: Row(
|
style: GoogleFonts.kanit(
|
||||||
mainAxisSize: MainAxisSize.min,
|
color: ColorCustom.greyBorder,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
fontSize: 20,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
fontWeight: FontWeight.w500,
|
||||||
children: [
|
|
||||||
SizedBox(
|
|
||||||
width: 106,
|
|
||||||
height: 32,
|
|
||||||
child: Text(
|
|
||||||
"ยืนยัน",
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: GoogleFonts.kanit(
|
|
||||||
color: Colors.white,
|
|
||||||
fontSize: 20,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -444,8 +423,6 @@ class _TransferCathayPayDetailState extends State<TransferCathayPayDetail> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
height: 136,
|
|
||||||
color: Colors.transparent,
|
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 10,
|
height: 10,
|
||||||
|
|||||||
@@ -147,6 +147,7 @@ class _TransferMoneyMenuPageState extends State<TransferMoneyMenuPage> {
|
|||||||
InkWell(
|
InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
showModalBottomSheet<void>(
|
showModalBottomSheet<void>(
|
||||||
|
useSafeArea: true,
|
||||||
context: context,
|
context: context,
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.vertical(
|
borderRadius: BorderRadius.vertical(
|
||||||
@@ -158,31 +159,6 @@ class _TransferMoneyMenuPageState extends State<TransferMoneyMenuPage> {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
child: Row(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
SizedBox(
|
|
||||||
width: 20,
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
"สมาชิก NEO PAY",
|
|
||||||
style: TextStyle(
|
|
||||||
color: Colors.white,
|
|
||||||
fontSize: 20,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Spacer(),
|
|
||||||
Icon(
|
|
||||||
Icons.wallet,
|
|
||||||
color: Colors.white,
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
width: 20,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
height: 48,
|
height: 48,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(100),
|
borderRadius: BorderRadius.circular(100),
|
||||||
@@ -193,7 +169,32 @@ class _TransferMoneyMenuPageState extends State<TransferMoneyMenuPage> {
|
|||||||
offset: Offset(0.75, 1.50),
|
offset: Offset(0.75, 1.50),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
color: Color(0xffd0315a),
|
color: Color(0xfffbfbfb),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
SizedBox(
|
||||||
|
width: 20,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
"สมาชิก NEO PAY".tr(),
|
||||||
|
style: TextStyle(
|
||||||
|
color: Color(0xff65676b),
|
||||||
|
fontSize: 20,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Spacer(),
|
||||||
|
Icon(
|
||||||
|
Icons.wallet,
|
||||||
|
color: Colors.black,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 20,
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -216,6 +217,18 @@ class _TransferMoneyMenuPageState extends State<TransferMoneyMenuPage> {
|
|||||||
// });
|
// });
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
|
height: 48,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(100),
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: Color(0x26000000),
|
||||||
|
blurRadius: 2,
|
||||||
|
offset: Offset(0.75, 1.50),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
color: Colors.grey,
|
||||||
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
@@ -224,7 +237,7 @@ class _TransferMoneyMenuPageState extends State<TransferMoneyMenuPage> {
|
|||||||
width: 20,
|
width: 20,
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"บัญชีธนาคาร",
|
"บัญชีธนาคาร".tr(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Color(0xff65676b),
|
color: Color(0xff65676b),
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
@@ -241,18 +254,6 @@ class _TransferMoneyMenuPageState extends State<TransferMoneyMenuPage> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
height: 48,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
borderRadius: BorderRadius.circular(100),
|
|
||||||
boxShadow: [
|
|
||||||
BoxShadow(
|
|
||||||
color: Color(0x26000000),
|
|
||||||
blurRadius: 2,
|
|
||||||
offset: Offset(0.75, 1.50),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
color: Colors.grey,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
@@ -588,7 +589,7 @@ class _TransferMoneyMenuPageState extends State<TransferMoneyMenuPage> {
|
|||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
"สแกน QR Code CATHAY PAY".tr(),
|
"สแกน QR Code NEO PAY".tr(),
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import 'package:google_fonts/google_fonts.dart';
|
|||||||
import 'package:mask_text_input_formatter/mask_text_input_formatter.dart';
|
import 'package:mask_text_input_formatter/mask_text_input_formatter.dart';
|
||||||
|
|
||||||
import '../api/api.dart';
|
import '../api/api.dart';
|
||||||
|
import '../utils/color_custom.dart';
|
||||||
import 'TransferPromtptPayDialog.dart';
|
import 'TransferPromtptPayDialog.dart';
|
||||||
|
|
||||||
class TransferPromptPay extends StatefulWidget {
|
class TransferPromptPay extends StatefulWidget {
|
||||||
@@ -96,36 +97,24 @@ class _TransferPromptPayState extends State<TransferPromptPay> {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
margin: EdgeInsets.only(left: 20, right: 20),
|
width: double.infinity,
|
||||||
width: MediaQuery.of(context).size.width,
|
margin: const EdgeInsets.symmetric(horizontal: 15),
|
||||||
height: 51,
|
child: Card(
|
||||||
decoration: BoxDecoration(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(40),
|
borderRadius: BorderRadius.circular(40),
|
||||||
color: Color(0xff9d001b),
|
),
|
||||||
),
|
child: Container(
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: EdgeInsets.all(10),
|
||||||
horizontal: 10,
|
child: Text(
|
||||||
vertical: 12,
|
"Next".tr(),
|
||||||
),
|
textAlign: TextAlign.center,
|
||||||
child: Row(
|
style: GoogleFonts.kanit(
|
||||||
mainAxisSize: MainAxisSize.min,
|
color: ColorCustom.greyBorder,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
fontSize: 20,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
fontWeight: FontWeight.w500,
|
||||||
children: [
|
|
||||||
SizedBox(
|
|
||||||
width: 106,
|
|
||||||
height: 32,
|
|
||||||
child: Text(
|
|
||||||
"Next".tr(),
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: GoogleFonts.kanit(
|
|
||||||
color: Colors.white,
|
|
||||||
fontSize: 20,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -418,36 +407,24 @@ class _TransferPromptPayDetailState extends State<TransferPromptPayDetail> {
|
|||||||
onTap: () async {
|
onTap: () async {
|
||||||
initPromptPay(context);
|
initPromptPay(context);
|
||||||
},
|
},
|
||||||
child: Container(
|
child: SizedBox(
|
||||||
width: MediaQuery.of(context).size.width,
|
width: double.infinity,
|
||||||
height: 51,
|
child: Card(
|
||||||
decoration: BoxDecoration(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(40),
|
borderRadius: BorderRadius.circular(40),
|
||||||
color: Color(0xff9d001b),
|
),
|
||||||
),
|
child: Container(
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: EdgeInsets.all(10),
|
||||||
horizontal: 10,
|
child: Text(
|
||||||
vertical: 12,
|
"Confirm".tr(),
|
||||||
),
|
textAlign: TextAlign.center,
|
||||||
child: Row(
|
style: GoogleFonts.kanit(
|
||||||
mainAxisSize: MainAxisSize.min,
|
color: ColorCustom.greyBorder,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
fontSize: 20,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
fontWeight: FontWeight.w500,
|
||||||
children: [
|
|
||||||
SizedBox(
|
|
||||||
width: 106,
|
|
||||||
height: 32,
|
|
||||||
child: Text(
|
|
||||||
"Confirm".tr(),
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: GoogleFonts.kanit(
|
|
||||||
color: Colors.white,
|
|
||||||
fontSize: 20,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -50,6 +50,9 @@ class Api {
|
|||||||
static String lockTest = BaseUrlBuilding + "api/V2/Authentication/LockUnlock";
|
static String lockTest = BaseUrlBuilding + "api/V2/Authentication/LockUnlock";
|
||||||
static String otp = "https://otp.thaibulksms.com/v2/otp/request";
|
static String otp = "https://otp.thaibulksms.com/v2/otp/request";
|
||||||
static String verify = "https://otp.thaibulksms.com/v2/otp/verify";
|
static String verify = "https://otp.thaibulksms.com/v2/otp/verify";
|
||||||
|
static String otpEmail = BaseUrlCathay+"common/user_login/otp/";
|
||||||
|
static String menuIcons = BaseUrlCathay+"common/icon";
|
||||||
|
|
||||||
static String banner = BaseUrlCathay + "common/banner/";
|
static String banner = BaseUrlCathay + "common/banner/";
|
||||||
static String promotion = BaseUrlCathay + "common/promotion/";
|
static String promotion = BaseUrlCathay + "common/promotion/";
|
||||||
static String getTokenAdmin = BaseUrlBuilding + "api/v3/User/Login";
|
static String getTokenAdmin = BaseUrlBuilding + "api/v3/User/Login";
|
||||||
@@ -58,11 +61,11 @@ class Api {
|
|||||||
static String c2bConfirm = BaseUrlBuilding + "api/v2/Payment/transaction/confirmC2B";
|
static String c2bConfirm = BaseUrlBuilding + "api/v2/Payment/transaction/confirmC2B";
|
||||||
static String getTransaction = BaseUrlBuilding + "api/v2/Payment/getTransactionWeb";
|
static String getTransaction = BaseUrlBuilding + "api/v2/Payment/getTransactionWeb";
|
||||||
|
|
||||||
static String BaseUrlBuildingCathay = "https://sathorn.cathay-pay.com/";
|
// static String BaseUrlBuildingCathay = "https://sathorn.cathay-pay.com/";
|
||||||
static String payPromptPayInitial = BaseUrlBuildingCathay + "api/v2/EPaymentBBL/TransferedPromptPayIDInitial";
|
static String payPromptPayInitial = BaseUrlBuilding + "api/v2/EPaymentBBL/TransferedPromptPayIDInitial";
|
||||||
static String payPromptPayConfirm = BaseUrlBuildingCathay + "api/v2/EPaymentBBL/TransferedPromptPayIDConfirm";
|
static String payPromptPayConfirm = BaseUrlBuilding + "api/v2/EPaymentBBL/TransferedPromptPayIDConfirm";
|
||||||
static String payThaiInitial = BaseUrlBuildingCathay + "api/v2/EPaymentBBL/TransferedPromptPayQRInitial";
|
static String payThaiInitial = BaseUrlBuilding + "api/v2/EPaymentBBL/TransferedPromptPayQRInitial";
|
||||||
static String payThaiConfirm = BaseUrlBuildingCathay + "api/v2/EPaymentBBL/TransferedPromptPayQRConfirm";
|
static String payThaiConfirm = BaseUrlBuilding + "api/v2/EPaymentBBL/TransferedPromptPayQRConfirm";
|
||||||
|
|
||||||
static String user = BaseUrlBuilding + "api/v1/User";
|
static String user = BaseUrlBuilding + "api/v1/User";
|
||||||
|
|
||||||
@@ -192,6 +195,48 @@ class Api {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Future<dynamic> getRaw(BuildContext context, String url) async {
|
||||||
|
try {
|
||||||
|
http.Response response;
|
||||||
|
|
||||||
|
if (tokenModel != null) {
|
||||||
|
printLongString("start api " + url + "\ntoken = " + tokenModel!.token!);
|
||||||
|
Map<String, String> requestHeaders = {HttpHeaders.contentTypeHeader: "application/json", "Authorization": "Bearer ${tokenModel!.token!}"};
|
||||||
|
print(requestHeaders.toString());
|
||||||
|
response = await http.get(Uri.parse(url), headers: requestHeaders);
|
||||||
|
} else {
|
||||||
|
Map<String, String> requestHeaders = {HttpHeaders.contentTypeHeader: "application/json"};
|
||||||
|
response = await http.get(Uri.parse(url), headers: requestHeaders);
|
||||||
|
}
|
||||||
|
printApiStatus(response);
|
||||||
|
|
||||||
|
if (response.statusCode == 200 || response.statusCode == 201) {
|
||||||
|
// final jsonResponse = json.decode(response.body);
|
||||||
|
printLongString("response api ${response.body}");
|
||||||
|
return response.body;
|
||||||
|
} else if (response.statusCode == 401) {
|
||||||
|
var value = await refreshToken(context);
|
||||||
|
if (value != null) {
|
||||||
|
var value = await get(context, url);
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
showAlertDialog(context, "กรุณาตรวจสอบ Internet ของท่าน");
|
||||||
|
// showAlertDialog(context, response.body);
|
||||||
|
try {
|
||||||
|
// final jsonResponse = json.decode(response.body);
|
||||||
|
print(response.body);
|
||||||
|
return response.body;
|
||||||
|
} catch (a) {
|
||||||
|
print(a);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
print(e);
|
||||||
|
// showAlertDialog(context, e.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static Future<dynamic> postLogin(BuildContext context, String url, String jsonParam) async {
|
static Future<dynamic> postLogin(BuildContext context, String url, String jsonParam) async {
|
||||||
printLongString(jsonParam);
|
printLongString(jsonParam);
|
||||||
try {
|
try {
|
||||||
@@ -371,7 +416,7 @@ class Api {
|
|||||||
printLongString(jsonParam);
|
printLongString(jsonParam);
|
||||||
try {
|
try {
|
||||||
var response;
|
var response;
|
||||||
if (tokenModel != null) {
|
if (tokenAdmin != null) {
|
||||||
Map<String, String> requestHeaders = {HttpHeaders.contentTypeHeader: "application/json", "Authorization": "Bearer $tokenAdmin"};
|
Map<String, String> requestHeaders = {HttpHeaders.contentTypeHeader: "application/json", "Authorization": "Bearer $tokenAdmin"};
|
||||||
response = await http.post(Uri.parse(url), body: jsonParam, headers: requestHeaders);
|
response = await http.post(Uri.parse(url), body: jsonParam, headers: requestHeaders);
|
||||||
} else {
|
} else {
|
||||||
@@ -379,7 +424,7 @@ class Api {
|
|||||||
response = await http.post(Uri.parse(url), body: jsonParam, headers: requestHeaders);
|
response = await http.post(Uri.parse(url), body: jsonParam, headers: requestHeaders);
|
||||||
}
|
}
|
||||||
|
|
||||||
// printApiStatus(response);
|
printApiStatus(response);
|
||||||
|
|
||||||
if (response.statusCode == 200 || response.statusCode == 201 || response.statusCode == 204) {
|
if (response.statusCode == 200 || response.statusCode == 201 || response.statusCode == 204) {
|
||||||
final jsonResponse = json.decode(response.body);
|
final jsonResponse = json.decode(response.body);
|
||||||
|
|||||||
73
neowallet_mobile/lib/model/menu_icon_model.dart
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
class MenuIconModel {
|
||||||
|
String? iconUid;
|
||||||
|
String? name;
|
||||||
|
String? link;
|
||||||
|
String? description;
|
||||||
|
String? fileUrl;
|
||||||
|
String? fileName;
|
||||||
|
bool? isUse;
|
||||||
|
int? statusId;
|
||||||
|
var createdBy;
|
||||||
|
var createdDatetime;
|
||||||
|
var updatedBy;
|
||||||
|
var updatedDatetime;
|
||||||
|
var search;
|
||||||
|
var ownerAgencyUid;
|
||||||
|
int? localID = -1;
|
||||||
|
String? token;
|
||||||
|
|
||||||
|
MenuIconModel(
|
||||||
|
{this.iconUid,
|
||||||
|
this.name,
|
||||||
|
this.link,
|
||||||
|
this.description,
|
||||||
|
this.fileUrl,
|
||||||
|
this.fileName,
|
||||||
|
this.isUse,
|
||||||
|
this.statusId,
|
||||||
|
this.createdBy,
|
||||||
|
this.createdDatetime,
|
||||||
|
this.updatedBy,
|
||||||
|
this.updatedDatetime,
|
||||||
|
this.search,
|
||||||
|
this.ownerAgencyUid,
|
||||||
|
this.token,
|
||||||
|
this.localID});
|
||||||
|
|
||||||
|
MenuIconModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
iconUid = json['icon_uid'];
|
||||||
|
name = json['name'];
|
||||||
|
link = json['link'];
|
||||||
|
description = json['description'];
|
||||||
|
fileUrl = json['file_url'];
|
||||||
|
fileName = json['file_name'];
|
||||||
|
isUse = json['is_use'];
|
||||||
|
statusId = json['status_id'];
|
||||||
|
createdBy = json['created_by'];
|
||||||
|
createdDatetime = json['created_datetime'];
|
||||||
|
updatedBy = json['updated_by'];
|
||||||
|
updatedDatetime = json['updated_datetime'];
|
||||||
|
search = json['search'];
|
||||||
|
ownerAgencyUid = json['owner_agency_uid'];
|
||||||
|
token = json['secret_token'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['icon_uid'] = this.iconUid;
|
||||||
|
data['name'] = this.name;
|
||||||
|
data['link'] = this.link;
|
||||||
|
data['description'] = this.description;
|
||||||
|
data['file_url'] = this.fileUrl;
|
||||||
|
data['file_name'] = this.fileName;
|
||||||
|
data['is_use'] = this.isUse;
|
||||||
|
data['status_id'] = this.statusId;
|
||||||
|
data['created_by'] = this.createdBy;
|
||||||
|
data['created_datetime'] = this.createdDatetime;
|
||||||
|
data['updated_by'] = this.updatedBy;
|
||||||
|
data['updated_datetime'] = this.updatedDatetime;
|
||||||
|
data['search'] = this.search;
|
||||||
|
data['owner_agency_uid'] = this.ownerAgencyUid;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -25,6 +25,7 @@ class ColorCustom {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static const red = Color(0xff9d001b);
|
||||||
static const white = Color(0xFFFFFFFF);
|
static const white = Color(0xFFFFFFFF);
|
||||||
static const black = Color(0xFF000000);
|
static const black = Color(0xFF000000);
|
||||||
static const primaryColor = Color(0xFFCFDFEB);
|
static const primaryColor = Color(0xFFCFDFEB);
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
|||||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||||
# In Windows, build-name is used as the major, minor, and patch parts
|
# In Windows, build-name is used as the major, minor, and patch parts
|
||||||
# of the product and file versions while build-number is used as the build suffix.
|
# of the product and file versions while build-number is used as the build suffix.
|
||||||
version: 1.0.0+2
|
version: 1.0.2+8
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: '>=2.19.3 <3.0.0'
|
sdk: '>=2.19.3 <3.0.0'
|
||||||
@@ -31,29 +31,33 @@ dependencies:
|
|||||||
http: any
|
http: any
|
||||||
google_fonts: ^6.0.1
|
google_fonts: ^6.0.1
|
||||||
camera: ^0.10.3+2
|
camera: ^0.10.3+2
|
||||||
pin_code_fields: ^7.4.0
|
pin_code_fields: ^8.0.1
|
||||||
shared_preferences: ^2.1.0
|
shared_preferences: ^2.1.0
|
||||||
path_provider: ^2.0.5
|
path_provider: ^2.0.5
|
||||||
image_picker: ^0.8.7+4
|
image_picker: ^0.8.7+4
|
||||||
intl: ^0.18.1
|
intl: ^0.19.0
|
||||||
font_awesome_flutter: ^10.4.0
|
font_awesome_flutter: ^10.4.0
|
||||||
signature: ^5.4.0
|
signature: ^5.4.0
|
||||||
mime: ^1.0.4
|
mime: ^2.0.0
|
||||||
device_info_plus: ^9.0.2
|
device_info_plus: ^9.0.2
|
||||||
qr_code_scanner: ^1.0.1
|
qr_code_scanner: ^1.0.1
|
||||||
qr_flutter: ^4.1.0
|
qr_flutter: ^4.1.0
|
||||||
flutter_launcher_icons: ^0.13.1
|
flutter_launcher_icons: ^0.13.1
|
||||||
webview_flutter: ^4.4.2
|
webview_flutter: ^4.4.2
|
||||||
image_gallery_saver: ^2.0.3
|
# image_gallery_saver: ^2.0.3
|
||||||
pull_to_refresh_flutter3: ^2.0.2
|
pull_to_refresh_flutter3: ^2.0.2
|
||||||
carousel_slider: ^4.2.1
|
carousel_slider: ^5.0.0
|
||||||
url_launcher: ^6.3.0
|
url_launcher: ^6.3.0
|
||||||
package_info_plus: ^8.0.2
|
package_info_plus: ^8.0.2
|
||||||
mask_text_input_formatter: ^2.9.0
|
mask_text_input_formatter: ^2.9.0
|
||||||
currency_text_input_formatter: ^2.2.5
|
currency_text_input_formatter: ^2.2.5
|
||||||
screenshot: ^2.5.0
|
screenshot: ^3.0.0
|
||||||
easy_localization: ^3.0.7
|
easy_localization: ^3.0.7
|
||||||
|
saver_gallery: ^4.0.0
|
||||||
|
permission_handler: ^11.3.1
|
||||||
|
|
||||||
|
dependency_overrides:
|
||||||
|
win32: ^5.5.4
|
||||||
|
|
||||||
flutter:
|
flutter:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
|
|||||||