update
@@ -6,7 +6,7 @@ buildscript {
|
||||
}
|
||||
|
||||
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"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#Thu Nov 21 13:48:17 ICT 2024
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"Welcome":"Welcome",
|
||||
"to CATHAY PAY":"to CATHAY PAY",
|
||||
"to CATHAY PAY":"to NEO PAY",
|
||||
"Log In":"Log In",
|
||||
"Register":"Register",
|
||||
"Username":"Username",
|
||||
@@ -116,6 +116,21 @@
|
||||
"Email ไม่ถูกต้อง":"Email is invalid",
|
||||
"หน้าหลัก":"Home",
|
||||
"สแกน":"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":"ยินดีต้อนรับ",
|
||||
"to CATHAY PAY":"สู่ CATHAY PAY",
|
||||
"to CATHAY PAY":"สู่ NEO PAY",
|
||||
"Log In":"เข้าสู่ระบบ",
|
||||
"Register":"สมัครสมาชิก",
|
||||
"Username":"ผู้ใช้งาน",
|
||||
@@ -116,8 +116,22 @@
|
||||
"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):
|
||||
- Flutter
|
||||
- Flutter (1.0.0)
|
||||
- image_gallery_saver (2.0.2):
|
||||
- Flutter
|
||||
- image_picker_ios (0.0.1):
|
||||
- Flutter
|
||||
- MTBBarcodeScanner (5.0.11)
|
||||
@@ -14,9 +12,13 @@ PODS:
|
||||
- path_provider_foundation (0.0.1):
|
||||
- Flutter
|
||||
- FlutterMacOS
|
||||
- permission_handler_apple (9.3.0):
|
||||
- Flutter
|
||||
- qr_code_scanner (0.2.0):
|
||||
- Flutter
|
||||
- MTBBarcodeScanner
|
||||
- saver_gallery (0.0.1):
|
||||
- Flutter
|
||||
- shared_preferences_foundation (0.0.1):
|
||||
- Flutter
|
||||
- FlutterMacOS
|
||||
@@ -29,11 +31,12 @@ DEPENDENCIES:
|
||||
- camera_avfoundation (from `.symlinks/plugins/camera_avfoundation/ios`)
|
||||
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
|
||||
- Flutter (from `Flutter`)
|
||||
- image_gallery_saver (from `.symlinks/plugins/image_gallery_saver/ios`)
|
||||
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
|
||||
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
|
||||
- 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`)
|
||||
- saver_gallery (from `.symlinks/plugins/saver_gallery/ios`)
|
||||
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
|
||||
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
|
||||
- webview_flutter_wkwebview (from `.symlinks/plugins/webview_flutter_wkwebview/ios`)
|
||||
@@ -49,16 +52,18 @@ EXTERNAL SOURCES:
|
||||
:path: ".symlinks/plugins/device_info_plus/ios"
|
||||
Flutter:
|
||||
:path: Flutter
|
||||
image_gallery_saver:
|
||||
:path: ".symlinks/plugins/image_gallery_saver/ios"
|
||||
image_picker_ios:
|
||||
:path: ".symlinks/plugins/image_picker_ios/ios"
|
||||
package_info_plus:
|
||||
:path: ".symlinks/plugins/package_info_plus/ios"
|
||||
path_provider_foundation:
|
||||
:path: ".symlinks/plugins/path_provider_foundation/darwin"
|
||||
permission_handler_apple:
|
||||
:path: ".symlinks/plugins/permission_handler_apple/ios"
|
||||
qr_code_scanner:
|
||||
:path: ".symlinks/plugins/qr_code_scanner/ios"
|
||||
saver_gallery:
|
||||
:path: ".symlinks/plugins/saver_gallery/ios"
|
||||
shared_preferences_foundation:
|
||||
:path: ".symlinks/plugins/shared_preferences_foundation/darwin"
|
||||
url_launcher_ios:
|
||||
@@ -70,16 +75,17 @@ SPEC CHECKSUMS:
|
||||
camera_avfoundation: dd002b0330f4981e1bbcb46ae9b62829237459a4
|
||||
device_info_plus: c6fb39579d0f423935b0c9ce7ee2f44b71b9fce6
|
||||
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
|
||||
image_gallery_saver: cb43cc43141711190510e92c460eb1655cd343cb
|
||||
image_picker_ios: c560581cceedb403a6ff17f2f816d7fea1421fc1
|
||||
MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb
|
||||
package_info_plus: 58f0028419748fad15bf008b270aaa8e54380b1c
|
||||
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
|
||||
permission_handler_apple: 9878588469a2b0d0fc1e048d9f43605f92e6cec2
|
||||
qr_code_scanner: bb67d64904c3b9658ada8c402e8b4d406d5d796e
|
||||
saver_gallery: 76172dc4bf6b40e66d694948ada9ff402304dd87
|
||||
shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
|
||||
url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe
|
||||
webview_flutter_wkwebview: 2a23822e9039b7b1bc52e5add778e5d89ad488d1
|
||||
|
||||
PODFILE CHECKSUM: 57c8aed26fba39d3ec9424816221f294a07c58eb
|
||||
|
||||
COCOAPODS: 1.15.2
|
||||
COCOAPODS: 1.16.2
|
||||
|
||||
@@ -141,6 +141,7 @@
|
||||
9705A1C41CF9048500538489 /* Embed Frameworks */,
|
||||
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
|
||||
1A038E6A347A908126F4CAA5 /* [CP] Embed Pods Frameworks */,
|
||||
AE4B7B02856EC8235D5750DA /* [CP] Copy Pods Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@@ -269,6 +270,23 @@
|
||||
shellPath = /bin/sh;
|
||||
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 */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import UIKit
|
||||
import Flutter
|
||||
|
||||
@UIApplicationMain
|
||||
@main
|
||||
@objc class AppDelegate: FlutterAppDelegate {
|
||||
override func application(
|
||||
_ application: UIApplication,
|
||||
|
||||
@@ -19,11 +19,11 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0.0</string>
|
||||
<string>1.0.1</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>2</string>
|
||||
<string>3</string>
|
||||
<key>LSApplicationCategoryType</key>
|
||||
<string></string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
|
||||
@@ -8,11 +8,13 @@ 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:image_gallery_saver/image_gallery_saver.dart';
|
||||
import 'package:qr_flutter/qr_flutter.dart';
|
||||
import 'package:saver_gallery/saver_gallery.dart';
|
||||
|
||||
import '../Home/HomePage.dart';
|
||||
import '../Home/home_bottom_menu_widget.dart';
|
||||
import '../api/api.dart';
|
||||
import '../utils/color_custom.dart';
|
||||
import '../utils/utils.dart';
|
||||
|
||||
class GetPaidPage extends StatefulWidget {
|
||||
@@ -47,7 +49,9 @@ class _GetPaidPageState extends State<GetPaidPage> {
|
||||
}
|
||||
|
||||
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, "บันทึกสำเร็จ");
|
||||
}
|
||||
|
||||
@@ -255,27 +259,23 @@ class _GetPaidPageState extends State<GetPaidPage> {
|
||||
onTap: () {
|
||||
saveQrCode();
|
||||
},
|
||||
child: Container(
|
||||
child: SizedBox(
|
||||
width: 147,
|
||||
height: 44,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Color(0x19000000),
|
||||
blurRadius: 2,
|
||||
offset: Offset(0.75, 1),
|
||||
child: Card(
|
||||
color: Colors.white,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(40),
|
||||
),
|
||||
],
|
||||
color: Color(0xff9d001b),
|
||||
),
|
||||
child: Center(
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
child: Text(
|
||||
"Save QR".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
style: GoogleFonts.kanit(
|
||||
color: ColorCustom.greyBorder,
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -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/TopUp/TopUpMenuPage.dart';
|
||||
import 'package:cathaypay_mobile/model/qrcode.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:image_gallery_saver/image_gallery_saver.dart';
|
||||
import 'package:qr_flutter/qr_flutter.dart';
|
||||
import 'package:saver_gallery/saver_gallery.dart';
|
||||
|
||||
import '../Home/HomePage.dart';
|
||||
import '../api/api.dart';
|
||||
import '../utils/color_custom.dart';
|
||||
import '../utils/utils.dart';
|
||||
import 'GetPaidShopByAmount.dart';
|
||||
|
||||
@@ -55,7 +57,8 @@ class _GetPaidPageState extends State<GetPaidShopPage> {
|
||||
}
|
||||
|
||||
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, "บันทึกสำเร็จ");
|
||||
}
|
||||
|
||||
@@ -263,27 +266,23 @@ class _GetPaidPageState extends State<GetPaidShopPage> {
|
||||
onTap: () {
|
||||
saveQrCode();
|
||||
},
|
||||
child: Container(
|
||||
child: SizedBox(
|
||||
width: 147,
|
||||
height: 44,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Color(0x19000000),
|
||||
blurRadius: 2,
|
||||
offset: Offset(0.75, 1),
|
||||
),
|
||||
],
|
||||
color: Color(0xff9d001b),
|
||||
),
|
||||
child: Center(
|
||||
child: Text(
|
||||
"บันทึก QR",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
child: Card(
|
||||
color: Colors.white,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(40),
|
||||
),
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
child: Text(
|
||||
"Save QR".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: GoogleFonts.kanit(
|
||||
color: ColorCustom.greyBorder,
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:carousel_slider/carousel_slider.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/model/banner_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:flutter/material.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:shared_preferences/shared_preferences.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
@@ -19,6 +22,7 @@ import 'package:url_launcher/url_launcher.dart';
|
||||
import '../api/api.dart';
|
||||
import '../model/promotion_model.dart';
|
||||
import '../model/token_model.dart';
|
||||
import '../utils/color_custom.dart';
|
||||
import '../utils/utils.dart';
|
||||
|
||||
Profile? profile;
|
||||
@@ -40,9 +44,38 @@ class _HomePageState extends State<HomePage> {
|
||||
getTokenAdmin();
|
||||
getBanner();
|
||||
getPromotion();
|
||||
checkAndRequestPermissions(skipIfExists: true);
|
||||
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 {
|
||||
Api.get(context, Api.profile).then((value) => {
|
||||
if (value != null) {initProfile(value)} else {clearProfile()}
|
||||
@@ -609,23 +642,15 @@ class _CardHomePageState extends State<CardHomePage> {
|
||||
return SafeArea(child: TopUpMenuPage());
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
child: SizedBox(
|
||||
width: 160,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Color(0x19000000),
|
||||
blurRadius: 4,
|
||||
offset: Offset(1, 1),
|
||||
),
|
||||
],
|
||||
color: Color(0xffd0315a),
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 12,
|
||||
vertical: 15,
|
||||
child: Card(
|
||||
color: Colors.white,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(40),
|
||||
),
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
@@ -636,7 +661,7 @@ class _CardHomePageState extends State<CardHomePage> {
|
||||
child: Text(
|
||||
"Wallet Topup".tr(),
|
||||
style: GoogleFonts.kanit(
|
||||
color: Colors.white,
|
||||
color: ColorCustom.red,
|
||||
fontSize: 18,
|
||||
),
|
||||
),
|
||||
@@ -645,11 +670,14 @@ class _CardHomePageState extends State<CardHomePage> {
|
||||
Image(
|
||||
image: AssetImage('images/home/icon_plus.png'),
|
||||
fit: BoxFit.cover,
|
||||
color: ColorCustom.red,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -749,23 +777,15 @@ class _CardHomePageState extends State<CardHomePage> {
|
||||
return SafeArea(child: PayPage());
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
child: SizedBox(
|
||||
width: 160,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Color(0x19000000),
|
||||
blurRadius: 4,
|
||||
offset: Offset(1, 1),
|
||||
),
|
||||
],
|
||||
color: Color(0xfff2f2f2),
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 12,
|
||||
vertical: 15,
|
||||
child: Card(
|
||||
color: Colors.white,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(40),
|
||||
),
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
@@ -776,7 +796,7 @@ class _CardHomePageState extends State<CardHomePage> {
|
||||
child: Text(
|
||||
"Pay".tr(),
|
||||
style: GoogleFonts.kanit(
|
||||
color: Color(0xffd0315a),
|
||||
color: ColorCustom.red,
|
||||
fontSize: 18,
|
||||
),
|
||||
),
|
||||
@@ -788,12 +808,15 @@ class _CardHomePageState extends State<CardHomePage> {
|
||||
child: Image(
|
||||
image: AssetImage('images/home/icon_qr.png'),
|
||||
fit: BoxFit.cover,
|
||||
color: ColorCustom.red,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -819,7 +842,8 @@ class _MenuHomePageState extends State<MenuHomePage> {
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Expanded(child: InkWell(
|
||||
Expanded(
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
showModalBottomSheet<void>(
|
||||
context: context,
|
||||
@@ -829,33 +853,14 @@ class _MenuHomePageState extends State<MenuHomePage> {
|
||||
return GetPaidPage();
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
color: Colors.white,
|
||||
),
|
||||
child: Column(
|
||||
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,
|
||||
child: Image(
|
||||
width: 80,
|
||||
height: 80,
|
||||
image: context.locale.toString() == "th" ? AssetImage('images/menu/27.png') : AssetImage('images/menu/22.png'),
|
||||
fit: BoxFit.fitHeight,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),),
|
||||
/* InkWell(
|
||||
onTap: () {
|
||||
showModalBottomSheet<void>(
|
||||
@@ -898,7 +903,8 @@ class _MenuHomePageState extends State<MenuHomePage> {
|
||||
SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Expanded(child: InkWell(
|
||||
Expanded(
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
@@ -908,37 +914,19 @@ class _MenuHomePageState extends State<MenuHomePage> {
|
||||
return TransferMoneyMenuPage();
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
color: Colors.white,
|
||||
),
|
||||
child: Column(
|
||||
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,
|
||||
child: Image(
|
||||
width: 80,
|
||||
height: 80,
|
||||
image: context.locale.toString() == "th" ? AssetImage('images/menu/26.png') : AssetImage('images/menu/23.png'),
|
||||
fit: BoxFit.fitHeight,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),),
|
||||
SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Expanded(child: InkWell(
|
||||
Expanded(
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
showModalBottomSheet<void>(
|
||||
context: context,
|
||||
@@ -948,33 +936,14 @@ class _MenuHomePageState extends State<MenuHomePage> {
|
||||
return PayPage();
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
color: Colors.white,
|
||||
),
|
||||
child: Column(
|
||||
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,
|
||||
child: Image(
|
||||
width: 80,
|
||||
height: 80,
|
||||
image: context.locale.toString() == "th" ? AssetImage('images/menu/25.png') : AssetImage('images/menu/24.png'),
|
||||
fit: BoxFit.fitHeight,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),),
|
||||
/* InkWell(
|
||||
onTap: () {
|
||||
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:flutter/material.dart';
|
||||
|
||||
@@ -27,7 +28,7 @@ class _HomePageState extends State<HomeBottomMenuWidget> {
|
||||
children: <Widget>[
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
padding: EdgeInsets.all(20),
|
||||
padding: EdgeInsets.all(10),
|
||||
decoration: BoxDecoration(
|
||||
boxShadow: [BoxShadow(color: Color.fromRGBO(0, 0, 0, 0.07999999821186066), offset: Offset(0, -4), blurRadius: 4)],
|
||||
color: Color.fromRGBO(255, 255, 255, 1),
|
||||
@@ -42,10 +43,10 @@ class _HomePageState extends State<HomeBottomMenuWidget> {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
height: 35,
|
||||
width: 35,
|
||||
height: 45,
|
||||
width: 45,
|
||||
child: Image(
|
||||
image: AssetImage('images/home/1.home.png'),
|
||||
image: AssetImage('images/home/15.png'),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
@@ -70,10 +71,10 @@ class _HomePageState extends State<HomeBottomMenuWidget> {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
height: 35,
|
||||
width: 35,
|
||||
height: 45,
|
||||
width: 45,
|
||||
child: Image(
|
||||
image: AssetImage('images/home/2.scan.png'),
|
||||
image: AssetImage('images/home/17.png'),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
@@ -101,17 +102,24 @@ class _HomePageState extends State<HomeBottomMenuWidget> {
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
// clearProfile();
|
||||
Navigator.popUntil(context, ModalRoute.withName('/'));
|
||||
Navigator.pushNamed(context, '/HomePage');
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => AllMenuPage(),
|
||||
),
|
||||
);
|
||||
},
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
height: 35,
|
||||
width: 35,
|
||||
height: 45,
|
||||
width: 45,
|
||||
child: Image(
|
||||
image: AssetImage('images/home/3.all.png'),
|
||||
image: AssetImage('images/home/19.png'),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -8,7 +8,6 @@ import 'package:package_info_plus/package_info_plus.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
import '../PinCodeVadidate.dart';
|
||||
import '../Register/register_data.dart';
|
||||
import '../api/api.dart';
|
||||
import '../model/token_model.dart';
|
||||
import '../utils/color_custom.dart';
|
||||
@@ -41,12 +40,8 @@ class _LoginPageState extends State<LoginPage> {
|
||||
}
|
||||
|
||||
Future<void> getProfile() async {
|
||||
Api.get(context, Api.profile).then((value) =>
|
||||
{
|
||||
if (value != null) {
|
||||
initProfile()
|
||||
} else
|
||||
{clearProfile()}
|
||||
Api.get(context, Api.profile).then((value) => {
|
||||
if (value != null) {initProfile()} else {clearProfile()}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -69,9 +64,7 @@ class _LoginPageState extends State<LoginPage> {
|
||||
}
|
||||
|
||||
refresh() {
|
||||
setState(() {
|
||||
|
||||
});
|
||||
setState(() {});
|
||||
}
|
||||
|
||||
String version = "";
|
||||
@@ -90,15 +83,11 @@ class _LoginPageState extends State<LoginPage> {
|
||||
return Scaffold(
|
||||
body: Stack(children: <Widget>[
|
||||
Container(
|
||||
width: MediaQuery
|
||||
.of(context)
|
||||
.size
|
||||
.width,
|
||||
height: MediaQuery
|
||||
.of(context)
|
||||
.size
|
||||
.height,
|
||||
child: Container(color: Colors.white,),
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: MediaQuery.of(context).size.height,
|
||||
child: Container(
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
@@ -124,10 +113,7 @@ class _LoginPageState extends State<LoginPage> {
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
width: MediaQuery
|
||||
.of(context)
|
||||
.size
|
||||
.width,
|
||||
width: MediaQuery.of(context).size.width,
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
@@ -168,8 +154,15 @@ class _LoginPageState extends State<LoginPage> {
|
||||
}
|
||||
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(),
|
||||
@@ -177,41 +170,29 @@ class _LoginPageState extends State<LoginPage> {
|
||||
onTap: () {
|
||||
Navigator.pushNamed(context, '/LoginValidate');
|
||||
},
|
||||
child: Container(
|
||||
width: MediaQuery
|
||||
.of(context)
|
||||
.size
|
||||
.width,
|
||||
decoration: BoxDecoration(
|
||||
child: SizedBox(
|
||||
width: double.infinity,
|
||||
child: Card(
|
||||
color: Colors.white,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(40),
|
||||
border: Border.all(
|
||||
color: Color(0xff9d001b),
|
||||
width: 1,
|
||||
side: BorderSide(color: ColorCustom.red, width: 1)
|
||||
),
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
vertical: 12,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
child: Text(
|
||||
"Log In".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: GoogleFonts.kanit(
|
||||
color: Color(0xff9d001b),
|
||||
color: ColorCustom.red,
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w300,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
InkWell(
|
||||
@@ -229,36 +210,25 @@ class _LoginPageState extends State<LoginPage> {
|
||||
),
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
width: MediaQuery
|
||||
.of(context)
|
||||
.size
|
||||
.width,
|
||||
decoration: BoxDecoration(
|
||||
child: SizedBox(
|
||||
width: double.infinity,
|
||||
child: Card(
|
||||
color: Colors.white,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(40),
|
||||
color: Color(0xffd0315a),
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
vertical: 12,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
child: Text(
|
||||
"Register".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: GoogleFonts.kanit(
|
||||
color: Colors.white,
|
||||
color: ColorCustom.red,
|
||||
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 '../api/api.dart';
|
||||
import '../utils/color_custom.dart';
|
||||
|
||||
TokenModel? tokenModel;
|
||||
|
||||
@@ -106,7 +107,7 @@ class _LoginValidateState extends State<LoginValidate> {
|
||||
|
||||
// TextEditingController username = TextEditingController(text: "admin");
|
||||
// TextEditingController password = TextEditingController(text: "P@ssword1");
|
||||
// TextEditingController username = TextEditingController(text: "toontest");
|
||||
// TextEditingController username = TextEditingController(text: "nataphonpan");
|
||||
// TextEditingController password = TextEditingController(text: "123456Aa");
|
||||
TextEditingController username = TextEditingController();
|
||||
TextEditingController password = TextEditingController();
|
||||
@@ -229,28 +230,25 @@ class _LoginValidateState extends State<LoginValidate> {
|
||||
}
|
||||
authen(context);
|
||||
},
|
||||
child: Container(
|
||||
width: 374,
|
||||
height: 48,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
color: Color(0xff9d001b),
|
||||
child: SizedBox(
|
||||
width: double.infinity,
|
||||
child: Card(
|
||||
color: Colors.white,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(40),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
child: Text(
|
||||
"Next".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: GoogleFonts.kanit(
|
||||
color: Colors.white,
|
||||
color: ColorCustom.greyBorder,
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -299,7 +299,7 @@ class _PayPageState extends State<PayPage> {
|
||||
),
|
||||
Expanded(
|
||||
child: Text(
|
||||
"สแกน QR Code CATHAY PAY".tr(),
|
||||
"สแกน QR Code NEO PAY".tr(),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
|
||||
@@ -13,6 +13,7 @@ import 'package:mask_text_input_formatter/mask_text_input_formatter.dart';
|
||||
|
||||
import '../TransferMoney/TransferPromtptPayDialog.dart';
|
||||
import '../api/api.dart';
|
||||
import '../utils/color_custom.dart';
|
||||
|
||||
class PayPromptPay extends StatefulWidget {
|
||||
const PayPromptPay({Key? key}) : super(key: key);
|
||||
@@ -97,36 +98,24 @@ class _TransferPromptPayState extends State<PayPromptPay> {
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(left: 20, right: 20),
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: 51,
|
||||
decoration: BoxDecoration(
|
||||
width: double.infinity,
|
||||
margin: const EdgeInsets.symmetric(horizontal: 15),
|
||||
child: Card(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(40),
|
||||
color: Color(0xff9d001b),
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
vertical: 12,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 106,
|
||||
height: 32,
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
child: Text(
|
||||
"Next".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: GoogleFonts.kanit(
|
||||
color: Colors.white,
|
||||
color: ColorCustom.greyBorder,
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -425,36 +414,24 @@ class _TransferPromptPayDetailState extends State<TransferPromptPayDetail> {
|
||||
Utils.showAlertDialog(context, "Price must more than 10 Baht");
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: 51,
|
||||
decoration: BoxDecoration(
|
||||
child: SizedBox(
|
||||
width: double.infinity,
|
||||
child: Card(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(40),
|
||||
color: Color(0xff9d001b),
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
vertical: 12,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 106,
|
||||
height: 32,
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
child: Text(
|
||||
"Confirm".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: GoogleFonts.kanit(
|
||||
color: Colors.white,
|
||||
color: ColorCustom.greyBorder,
|
||||
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/PinCodeVadidate.dart';
|
||||
import 'package:cathaypay_mobile/utils/utils.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:qr_code_scanner/qr_code_scanner.dart';
|
||||
|
||||
import '../api/api.dart';
|
||||
import '../utils/color_custom.dart';
|
||||
|
||||
class PayQrPage extends StatefulWidget {
|
||||
const PayQrPage({Key? key, required this.code}) : super(key: key);
|
||||
@@ -184,7 +185,7 @@ class _PayQrPageState extends State<PayQrPage> {
|
||||
],
|
||||
elevation: 0,
|
||||
title: Text(
|
||||
"จ่ายเงิน",
|
||||
"Pay".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: GoogleFonts.kanit(
|
||||
color: Colors.black,
|
||||
@@ -201,7 +202,7 @@ class _PayQrPageState extends State<PayQrPage> {
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"ชื่อ",
|
||||
"ชื่อ".tr(),
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 16,
|
||||
@@ -240,7 +241,7 @@ class _PayQrPageState extends State<PayQrPage> {
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
"เบอร์โทรศัพท์",
|
||||
"เบอร์โทรศัพท์".tr(),
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
@@ -262,7 +263,7 @@ class _PayQrPageState extends State<PayQrPage> {
|
||||
height: 10,
|
||||
),
|
||||
Text(
|
||||
"จำนวนเงินที่โอน / จ่าย",
|
||||
"จำนวนเงินที่โอน / จ่าย".tr(),
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 16,
|
||||
@@ -318,7 +319,7 @@ class _PayQrPageState extends State<PayQrPage> {
|
||||
controller: price,
|
||||
style: TextStyle(fontSize: 24),
|
||||
decoration: InputDecoration(
|
||||
hintText: 'จำนวนเงินที่โอน',
|
||||
hintText: "จำนวนเงินที่โอน / จ่าย".tr(),
|
||||
border: InputBorder.none,
|
||||
contentPadding: EdgeInsets.symmetric(horizontal: 16),
|
||||
),
|
||||
@@ -328,7 +329,7 @@ class _PayQrPageState extends State<PayQrPage> {
|
||||
height: 10,
|
||||
),
|
||||
Text(
|
||||
"ใช้แต้ม Cathay Pay แทนเงินสด",
|
||||
"ใช้แต้ม NEO PAY แทนเงินสด".tr(),
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 16,
|
||||
@@ -336,7 +337,7 @@ class _PayQrPageState extends State<PayQrPage> {
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"คะแนนของคุณ : 12,000 แต้ม",
|
||||
"${"คะแนนของคุณ".tr()} : 12,000 ${"แต้ม".tr()}",
|
||||
style: TextStyle(
|
||||
color: Color(0xff9d001b),
|
||||
fontSize: 14,
|
||||
@@ -361,7 +362,7 @@ class _PayQrPageState extends State<PayQrPage> {
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
"0 แต้ม",
|
||||
"10 ${"แต้ม".tr()}",
|
||||
textAlign: TextAlign.right,
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
@@ -395,7 +396,7 @@ class _PayQrPageState extends State<PayQrPage> {
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
"0 บาท",
|
||||
"100 ${"Baht".tr()}",
|
||||
textAlign: TextAlign.right,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
@@ -408,7 +409,7 @@ class _PayQrPageState extends State<PayQrPage> {
|
||||
),
|
||||
Center(
|
||||
child: Text(
|
||||
"1 แต้ม = 10 สตางค์",
|
||||
"1 แต้ม = 10 สตางค์".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
@@ -418,6 +419,8 @@ class _PayQrPageState extends State<PayQrPage> {
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: 136,
|
||||
color: Colors.transparent,
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
@@ -426,7 +429,7 @@ class _PayQrPageState extends State<PayQrPage> {
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
"ยอดเงินทั้งหมด",
|
||||
"ยอดเงินทั้งหมด".tr(),
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 16,
|
||||
@@ -443,7 +446,7 @@ class _PayQrPageState extends State<PayQrPage> {
|
||||
),
|
||||
),
|
||||
Text(
|
||||
" บาท",
|
||||
" ${"Baht".tr()}",
|
||||
textAlign: TextAlign.right,
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
@@ -465,36 +468,24 @@ class _PayQrPageState extends State<PayQrPage> {
|
||||
checkTypePay();
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: 51,
|
||||
decoration: BoxDecoration(
|
||||
child: SizedBox(
|
||||
width: double.infinity,
|
||||
child: Card(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(40),
|
||||
color: Color(0xff9d001b),
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
vertical: 12,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 106,
|
||||
height: 32,
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
child: Text(
|
||||
"ยืนยัน",
|
||||
"Confirm".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: GoogleFonts.kanit(
|
||||
color: Colors.white,
|
||||
color: ColorCustom.greyBorder,
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -503,8 +494,6 @@ class _PayQrPageState extends State<PayQrPage> {
|
||||
),
|
||||
],
|
||||
),
|
||||
height: 136,
|
||||
color: Colors.transparent,
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:cathaypay_mobile/GetPaid/GetPaid.dart';
|
||||
import 'package:cathaypay_mobile/Home/HomePage.dart';
|
||||
import 'package:cathaypay_mobile/Pay/PayQrDialog.dart';
|
||||
import 'package:cathaypay_mobile/PinCodeVadidate.dart';
|
||||
import 'package:cathaypay_mobile/main.dart';
|
||||
import 'package:cathaypay_mobile/utils/utils.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
@@ -13,6 +15,7 @@ import 'package:intl/intl.dart';
|
||||
import 'package:qr_code_scanner/qr_code_scanner.dart';
|
||||
|
||||
import '../api/api.dart';
|
||||
import '../utils/color_custom.dart';
|
||||
|
||||
class PayThaiQr extends StatefulWidget {
|
||||
const PayThaiQr({Key? key, required this.code}) : super(key: key);
|
||||
@@ -95,7 +98,7 @@ class _PayQrPageState extends State<PayThaiQr> {
|
||||
],
|
||||
elevation: 0,
|
||||
title: Text(
|
||||
"จ่ายเงิน",
|
||||
"Pay".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: GoogleFonts.kanit(
|
||||
color: Colors.black,
|
||||
@@ -112,7 +115,7 @@ class _PayQrPageState extends State<PayThaiQr> {
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"จำนวนเงินที่โอน / จ่าย",
|
||||
"จำนวนเงินที่โอน / จ่าย".tr(),
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 16,
|
||||
@@ -168,7 +171,7 @@ class _PayQrPageState extends State<PayThaiQr> {
|
||||
controller: price,
|
||||
style: TextStyle(fontSize: 24),
|
||||
decoration: InputDecoration(
|
||||
hintText: 'จำนวนเงินที่โอน',
|
||||
hintText: "จำนวนเงินที่โอน / จ่าย".tr(),
|
||||
border: InputBorder.none,
|
||||
contentPadding: EdgeInsets.symmetric(horizontal: 16),
|
||||
),
|
||||
@@ -178,7 +181,7 @@ class _PayQrPageState extends State<PayThaiQr> {
|
||||
height: 10,
|
||||
),
|
||||
Text(
|
||||
"ใช้แต้ม Cathay Pay แทนเงินสด",
|
||||
"ใช้แต้ม NEO PAY แทนเงินสด".tr(),
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 16,
|
||||
@@ -186,7 +189,7 @@ class _PayQrPageState extends State<PayThaiQr> {
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"คะแนนของคุณ : 12,000 แต้ม",
|
||||
"${"คะแนนของคุณ".tr()} : 12,000 ${"แต้ม".tr()}",
|
||||
style: TextStyle(
|
||||
color: Color(0xff9d001b),
|
||||
fontSize: 14,
|
||||
@@ -211,7 +214,7 @@ class _PayQrPageState extends State<PayThaiQr> {
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
"0 แต้ม",
|
||||
"10 ${"แต้ม".tr()}",
|
||||
textAlign: TextAlign.right,
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
@@ -245,7 +248,7 @@ class _PayQrPageState extends State<PayThaiQr> {
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
"0 บาท",
|
||||
"100 ${"Baht".tr()}",
|
||||
textAlign: TextAlign.right,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
@@ -258,7 +261,7 @@ class _PayQrPageState extends State<PayThaiQr> {
|
||||
),
|
||||
Center(
|
||||
child: Text(
|
||||
"1 แต้ม = 10 สตางค์",
|
||||
"1 แต้ม = 10 สตางค์".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
@@ -278,7 +281,7 @@ class _PayQrPageState extends State<PayThaiQr> {
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
"ยอดเงินทั้งหมด",
|
||||
"ยอดเงินทั้งหมด".tr(),
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 16,
|
||||
@@ -295,7 +298,7 @@ class _PayQrPageState extends State<PayThaiQr> {
|
||||
),
|
||||
),
|
||||
Text(
|
||||
" บาท",
|
||||
" ${"Baht".tr()}",
|
||||
textAlign: TextAlign.right,
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
@@ -318,36 +321,25 @@ class _PayQrPageState extends State<PayThaiQr> {
|
||||
initC2B();
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
child: SizedBox(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: 51,
|
||||
decoration: BoxDecoration(
|
||||
child: Card(
|
||||
color: Colors.white,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(40),
|
||||
color: Color(0xff9d001b),
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
vertical: 12,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 106,
|
||||
height: 32,
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
child: Text(
|
||||
"ยืนยัน",
|
||||
"Confirm".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: GoogleFonts.kanit(
|
||||
color: Colors.white,
|
||||
color: ColorCustom.greyBorder,
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -8,6 +8,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
|
||||
import '../api/api.dart';
|
||||
import '../utils/color_custom.dart';
|
||||
import 'id_card_model.dart';
|
||||
|
||||
List<CameraDescription> CameraApp = [];
|
||||
@@ -177,24 +178,27 @@ class TakePictureScreenState extends State<CameraCardID> {
|
||||
}
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
child: SizedBox(
|
||||
width: 150,
|
||||
padding: EdgeInsets.all(5),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
color: Color(0xff9d001b),
|
||||
child: Card(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(40),
|
||||
),
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
child: Text(
|
||||
"Confirm".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: GoogleFonts.kanit(
|
||||
color: Colors.white,
|
||||
color: ColorCustom.greyBorder,
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20,)
|
||||
],
|
||||
);
|
||||
|
||||
@@ -8,6 +8,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
|
||||
import '../api/api.dart';
|
||||
import '../utils/color_custom.dart';
|
||||
import 'camera_card_id.dart';
|
||||
import 'id_card_model.dart';
|
||||
|
||||
@@ -154,24 +155,27 @@ class TakePictureScreenState extends State<CameraPassport> {
|
||||
postImagePath(File(imageFront));
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
child: SizedBox(
|
||||
width: 150,
|
||||
padding: EdgeInsets.all(5),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
color: Color(0xff9d001b),
|
||||
child: Card(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(40),
|
||||
),
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
child: Text(
|
||||
"Confirm".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: GoogleFonts.kanit(
|
||||
color: Colors.white,
|
||||
color: ColorCustom.greyBorder,
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 20,
|
||||
)
|
||||
|
||||
@@ -10,6 +10,7 @@ import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:pin_code_fields/pin_code_fields.dart';
|
||||
|
||||
import '../api/api.dart';
|
||||
import '../utils/color_custom.dart';
|
||||
|
||||
TextEditingController _textEditingController = TextEditingController();
|
||||
|
||||
@@ -85,24 +86,29 @@ class _OtpPageState extends State<OtpPage> {
|
||||
// String otp = "";
|
||||
String refno = "";
|
||||
String token = "";
|
||||
String otpConfirm = "";
|
||||
|
||||
getOtp() async {
|
||||
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),
|
||||
setState(() {
|
||||
token = value["token"];
|
||||
refno = value["refno"];
|
||||
otpConfirm = value.toString();
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
verify(String 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 ไม่ถูกต้อง")}
|
||||
});
|
||||
if (otp == otpConfirm) {
|
||||
Navigator.pushNamed(context, '/PolicyPage');
|
||||
} else {
|
||||
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) {
|
||||
@@ -142,7 +148,7 @@ class _OtpPageState extends State<OtpPage> {
|
||||
padding: EdgeInsets.all(10),
|
||||
child: Column(mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center, children: [
|
||||
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,
|
||||
style: GoogleFonts.kanit(
|
||||
color: Color(0xff65676b),
|
||||
@@ -287,28 +293,24 @@ class _OtpPageState extends State<OtpPage> {
|
||||
onTap: () {
|
||||
verify(_textEditingController.text);
|
||||
},
|
||||
child: Container(
|
||||
child: SizedBox(
|
||||
width: 374,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
color: Color(0xff9d001b),
|
||||
child: Card(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(40),
|
||||
),
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
child: Text(
|
||||
"Confirm".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: GoogleFonts.kanit(
|
||||
color: Colors.white,
|
||||
color: ColorCustom.greyBorder,
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
|
||||
@@ -27,7 +27,7 @@ class _PolicyPageState extends State<PolicyPage> {
|
||||
controller = WebViewController()
|
||||
..setJavaScriptMode(JavaScriptMode.unrestricted)
|
||||
..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;
|
||||
|
||||
@@ -5,6 +5,10 @@ import 'package:google_fonts/google_fonts.dart';
|
||||
|
||||
import 'camera_passport.dart';
|
||||
|
||||
|
||||
var isPassport = false;
|
||||
|
||||
|
||||
class PreRegisterPage extends StatefulWidget {
|
||||
const PreRegisterPage({Key? key}) : super(key: key);
|
||||
|
||||
@@ -67,6 +71,7 @@ class _LoginPageState extends State<PreRegisterPage> {
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
isPassport = false;
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
@@ -77,22 +82,11 @@ class _LoginPageState extends State<PreRegisterPage> {
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
margin: EdgeInsets.symmetric(horizontal: 30,vertical: 10),
|
||||
child: Card(
|
||||
color: Colors.green.shade200,
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
padding: EdgeInsets.all(30),
|
||||
child: Text(
|
||||
"บัตรประชาชน".tr(),
|
||||
style: GoogleFonts.kanit(
|
||||
color: Colors.black,
|
||||
fontSize: 22,
|
||||
),
|
||||
),
|
||||
)),
|
||||
child: context.locale.toString()=="th"?Image.asset("images/register/thaicard_th.png"):Image.asset("images/register/thaicard_en.png")
|
||||
)),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
isPassport = true;
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
@@ -103,19 +97,7 @@ class _LoginPageState extends State<PreRegisterPage> {
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
margin: EdgeInsets.symmetric(horizontal: 30,vertical: 10),
|
||||
child: Card(
|
||||
color: Colors.red.shade200,
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
padding: EdgeInsets.all(30),
|
||||
child: Text(
|
||||
"พาสปอร์ต".tr(),
|
||||
style: GoogleFonts.kanit(
|
||||
color: Colors.black,
|
||||
fontSize: 22,
|
||||
),
|
||||
),
|
||||
)),
|
||||
child: context.locale.toString()=="th"?Image.asset("images/register/passport_th.png"):Image.asset("images/register/passport_en.png")
|
||||
)),
|
||||
SizedBox(height: 40,)
|
||||
],
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:cathaypay_mobile/Register/camera_card_id.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_occupation.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 '../utils/calendar_picker.dart';
|
||||
import '../utils/color_custom.dart';
|
||||
|
||||
TextEditingController name = TextEditingController(text: idCardFront?.nameThai ?? "");
|
||||
TextEditingController email = TextEditingController();
|
||||
@@ -155,6 +157,8 @@ class _RegisterDataState extends State<RegisterData> {
|
||||
),*/
|
||||
],
|
||||
),
|
||||
isPassport?Container():Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(0, 10, 0, 10),
|
||||
child: Container(
|
||||
@@ -209,6 +213,8 @@ class _RegisterDataState extends State<RegisterData> {
|
||||
),*/
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
/*Padding(
|
||||
padding: const EdgeInsets.fromLTRB(0, 10, 0, 10),
|
||||
child: Container(
|
||||
@@ -1201,19 +1207,19 @@ class _RegisterDataState extends State<RegisterData> {
|
||||
),
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
child: SizedBox(
|
||||
width: 374,
|
||||
height: 56,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
color: Color(0xff9d001b),
|
||||
child: Card(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(40),
|
||||
),
|
||||
child: Center(
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
child: Text(
|
||||
"Next".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: GoogleFonts.kanit(
|
||||
color: Colors.white,
|
||||
color: ColorCustom.greyBorder,
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
@@ -1221,6 +1227,7 @@ class _RegisterDataState extends State<RegisterData> {
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -7,6 +7,7 @@ import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
|
||||
import '../api/api.dart';
|
||||
import '../utils/color_custom.dart';
|
||||
|
||||
String imageEkycPath = "";
|
||||
|
||||
@@ -165,23 +166,27 @@ class _RegisterPicturePageState extends State<RegisterPicturePage> {
|
||||
onTap: () {
|
||||
_imageFile != null ? Navigator.pushNamed(context, '/RegisterSignaturePage') : Navigator.pushNamed(context, '/RegisterSignaturePage');
|
||||
},
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
color: Color(0xff9d001b),
|
||||
child: SizedBox(
|
||||
width: double.infinity,
|
||||
child: Card(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(40),
|
||||
),
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
child: Text(
|
||||
"Next".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: GoogleFonts.kanit(
|
||||
color: Colors.white,
|
||||
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 '../api/api.dart';
|
||||
import '../utils/color_custom.dart';
|
||||
|
||||
class RegisterSignaturePage extends StatefulWidget {
|
||||
const RegisterSignaturePage({Key? key}) : super(key: key);
|
||||
@@ -62,7 +63,7 @@ class _RegisterSignaturePageState extends State<RegisterSignaturePage> {
|
||||
"Password": password.text,
|
||||
"ConfirmPassword": passwordConfirm.text,
|
||||
"MobileDeviceId": deviceId,
|
||||
"PersonalCardId": idCardFront?.idCard,
|
||||
"PersonalCardId": idCardEditText.text,
|
||||
"MaxCardID": phone.text,
|
||||
"UserType": "P",
|
||||
"CustomerTypeId": "P01",
|
||||
@@ -229,25 +230,27 @@ class _RegisterSignaturePageState extends State<RegisterSignaturePage> {
|
||||
onTap: () async {
|
||||
signatureCapture();
|
||||
},
|
||||
child: Container(
|
||||
child: SizedBox(
|
||||
width: double.infinity,
|
||||
margin: EdgeInsets.only(left: 20, right: 20, bottom: 20, top: 20),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
color: Color(0xff9d001b),
|
||||
child: Card(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(40),
|
||||
),
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
child: Text(
|
||||
"Next".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: GoogleFonts.kanit(
|
||||
color: Colors.white,
|
||||
color: ColorCustom.greyBorder,
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
]),
|
||||
),
|
||||
|
||||
@@ -444,7 +444,7 @@ class _TopUpHistoryState extends State<TopUpHistory> {
|
||||
"invoiceId": "",
|
||||
"referencE1": "",
|
||||
"referencE2": "",
|
||||
"topupStatus": "WALLETADDED",
|
||||
"paymentStatus": "WALLETADDED",
|
||||
"paymentChannel": "",
|
||||
"createDatefrom": end,
|
||||
"createDateto": start,
|
||||
|
||||
@@ -6,7 +6,7 @@ import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.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 '../Home/HomePage.dart';
|
||||
@@ -65,7 +65,9 @@ class _TransferPromptPayDetailState extends State<TopUpAmountPage> {
|
||||
}
|
||||
|
||||
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(
|
||||
context,
|
||||
"บันทึกสำเร็จ",
|
||||
@@ -80,7 +82,9 @@ class _TransferPromptPayDetailState extends State<TopUpAmountPage> {
|
||||
captureQrCode() {
|
||||
screenshotController.capture().then((Uint8List? image) {
|
||||
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(
|
||||
context,
|
||||
"บันทึกสำเร็จ",
|
||||
@@ -256,72 +260,83 @@ class _TransferPromptPayDetailState extends State<TopUpAmountPage> {
|
||||
onTap: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(bottom: 15),
|
||||
width: MediaQuery.of(context).size.width / 3.5,
|
||||
height: 46,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
child: SizedBox(
|
||||
width: MediaQuery.of(context).size.width / 3,
|
||||
child: Card(
|
||||
color: Color(0xff2d2d2d),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(40),
|
||||
),
|
||||
child: Center(
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
child: Text(
|
||||
"ยกเลิก",
|
||||
"ยกเลิก".tr(),
|
||||
maxLines: 1,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w300,
|
||||
style: GoogleFonts.kanit(
|
||||
color: ColorCustom.white,
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
)),
|
||||
)),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Navigator.pushNamed(context, '/HomePage');
|
||||
},
|
||||
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(
|
||||
"กลับสู่หน้าหลัก",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
child: SizedBox(
|
||||
width: MediaQuery.of(context).size.width / 3,
|
||||
child: Card(
|
||||
color: Colors.white,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w300,
|
||||
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.greyBorder,
|
||||
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(
|
||||
child: SizedBox(
|
||||
width: MediaQuery.of(context).size.width / 3,
|
||||
child: Card(
|
||||
color: Colors.white,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w300,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(40),
|
||||
),
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
child: Text(
|
||||
"Save QR".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: GoogleFonts.kanit(
|
||||
color: ColorCustom.greyBorder,
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
)),
|
||||
)),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
@@ -486,36 +501,25 @@ class _TransferPromptPayDetailState extends State<TopUpAmountPage> {
|
||||
onTap: () async {
|
||||
initTopUp();
|
||||
},
|
||||
child: Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: 51,
|
||||
decoration: BoxDecoration(
|
||||
child: SizedBox(
|
||||
width: double.infinity,
|
||||
child: Card(
|
||||
color: Colors.white,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(40),
|
||||
color: Color(0xff9d001b),
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
vertical: 12,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 106,
|
||||
height: 32,
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
child: Text(
|
||||
"Create QR code".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: GoogleFonts.kanit(
|
||||
color: Colors.white,
|
||||
color: ColorCustom.greyBorder,
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -6,12 +6,11 @@ import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.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:saver_gallery/saver_gallery.dart';
|
||||
import 'package:screenshot/screenshot.dart';
|
||||
|
||||
import '../Home/HomePage.dart';
|
||||
import '../Numpad.dart';
|
||||
import '../api/api.dart';
|
||||
import '../model/qrcode.dart';
|
||||
|
||||
@@ -25,28 +24,30 @@ class TopUpMyQrPage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _TransferPromptPayDetailState extends State<TopUpMyQrPage> {
|
||||
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
initMyQr();
|
||||
super.initState();
|
||||
}
|
||||
|
||||
|
||||
bool loading = false;
|
||||
|
||||
QrCodeModel? myQrCode;
|
||||
|
||||
initMyQr() {
|
||||
var param = jsonEncode(<dynamic, dynamic>{"MobileDeviceNo": profile?.phoneNumber ?? "", "Note": "myQr",});
|
||||
var param = jsonEncode(<dynamic, dynamic>{
|
||||
"MobileDeviceNo": profile?.phoneNumber ?? "",
|
||||
"Note": "myQr",
|
||||
});
|
||||
Api.post(context, Api.myQrCode, param).then((value) => {
|
||||
if (value != null) {initQrCode(value)} else {}
|
||||
});
|
||||
}
|
||||
|
||||
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(
|
||||
context,
|
||||
"บันทึกสำเร็จ",
|
||||
@@ -56,13 +57,14 @@ class _TransferPromptPayDetailState extends State<TopUpMyQrPage> {
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
ScreenshotController screenshotController = ScreenshotController();
|
||||
|
||||
captureQrCode() {
|
||||
screenshotController.capture().then((Uint8List? image) {
|
||||
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(
|
||||
context,
|
||||
"บันทึกสำเร็จ",
|
||||
@@ -366,10 +368,7 @@ class _TransferPromptPayDetailState extends State<TopUpMyQrPage> {
|
||||
child: Screenshot(
|
||||
controller: screenshotController,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(width: 1.0, color: Colors.grey),
|
||||
color: Colors.white
|
||||
),
|
||||
decoration: BoxDecoration(border: Border.all(width: 1.0, color: Colors.grey), color: Colors.white),
|
||||
padding: EdgeInsets.all(20),
|
||||
margin: EdgeInsets.all(20),
|
||||
child: Column(
|
||||
@@ -459,83 +458,97 @@ class _TransferPromptPayDetailState extends State<TopUpMyQrPage> {
|
||||
),
|
||||
))),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
height: 10,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
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(0xff2d2d2d),
|
||||
),
|
||||
child: Center(
|
||||
child: Text(
|
||||
"ยกเลิก",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w300,
|
||||
),
|
||||
)),
|
||||
)),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Navigator.pushNamed(context, '/HomePage');
|
||||
},
|
||||
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(
|
||||
"กลับสู่หน้าหลัก",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
child: SizedBox(
|
||||
width: MediaQuery.of(context).size.width / 3,
|
||||
child: Card(
|
||||
color: Colors.white,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w300,
|
||||
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.greyBorder,
|
||||
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(
|
||||
child: SizedBox(
|
||||
width: MediaQuery.of(context).size.width / 3,
|
||||
child: Card(
|
||||
color: Colors.white,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w300,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(40),
|
||||
),
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
child: Text(
|
||||
"Save QR".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: GoogleFonts.kanit(
|
||||
color: ColorCustom.greyBorder,
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
)),
|
||||
)),
|
||||
],
|
||||
),
|
||||
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(
|
||||
height: 20,
|
||||
),
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
|
||||
import '../PinCodeVadidate.dart';
|
||||
import '../utils/color_custom.dart';
|
||||
import 'TransferCathayPayDialog.dart';
|
||||
|
||||
class TransferCathayPay extends StatefulWidget {
|
||||
@@ -18,7 +20,7 @@ class _TransferCathayPayState extends State<TransferCathayPay> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
return Scaffold(body: SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
@@ -32,7 +34,7 @@ class _TransferCathayPayState extends State<TransferCathayPay> {
|
||||
color: Colors.black,
|
||||
)),
|
||||
Text(
|
||||
"โอนเงินให้สมาชิก NEO PAY",
|
||||
"โอนเงินให้สมาชิก NEO PAY".tr(),
|
||||
style: TextStyle(
|
||||
color: Color(0xff050505),
|
||||
fontSize: 20,
|
||||
@@ -40,7 +42,7 @@ class _TransferCathayPayState extends State<TransferCathayPay> {
|
||||
)
|
||||
],
|
||||
),
|
||||
Spacer(),
|
||||
SizedBox(height: 20,),
|
||||
Container(
|
||||
child: TextField(
|
||||
keyboardType: TextInputType.number,
|
||||
@@ -49,7 +51,7 @@ class _TransferCathayPayState extends State<TransferCathayPay> {
|
||||
],
|
||||
controller: _phone,
|
||||
decoration: InputDecoration(
|
||||
hintText: 'เบอร์โทรศัพท์ผู้รับ',
|
||||
hintText: 'เบอร์โทรศัพท์ผู้รับ'.tr(),
|
||||
border: InputBorder.none,
|
||||
contentPadding: EdgeInsets.symmetric(horizontal: 16),
|
||||
),
|
||||
@@ -61,7 +63,7 @@ class _TransferCathayPayState extends State<TransferCathayPay> {
|
||||
color: Color(0xfff2f2f2),
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
SizedBox(height: 20,),
|
||||
InkWell(
|
||||
onTap: () async {
|
||||
showModalBottomSheet<void>(
|
||||
@@ -78,36 +80,24 @@ class _TransferCathayPayState extends State<TransferCathayPay> {
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(left: 20, right: 20),
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: 51,
|
||||
decoration: BoxDecoration(
|
||||
width: double.infinity,
|
||||
margin: const EdgeInsets.symmetric(horizontal: 15),
|
||||
child: Card(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(40),
|
||||
color: Color(0xff9d001b),
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
vertical: 12,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 106,
|
||||
height: 32,
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
child: Text(
|
||||
"ต่อไป",
|
||||
"Next".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: GoogleFonts.kanit(
|
||||
color: Colors.white,
|
||||
color: ColorCustom.greyBorder,
|
||||
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,
|
||||
title: Text(
|
||||
"โอนเงิน",
|
||||
"Transfer Money".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: GoogleFonts.kanit(
|
||||
color: Colors.black,
|
||||
@@ -168,7 +158,7 @@ class _TransferCathayPayDetailState extends State<TransferCathayPayDetail> {
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"ชื่อ",
|
||||
"ชื่อ".tr(),
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 16,
|
||||
@@ -188,7 +178,7 @@ class _TransferCathayPayDetailState extends State<TransferCathayPayDetail> {
|
||||
children: [
|
||||
Spacer(),
|
||||
Text(
|
||||
"กมลรวี กอสัมพันธ์",
|
||||
"",
|
||||
textAlign: TextAlign.right,
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
@@ -207,7 +197,7 @@ class _TransferCathayPayDetailState extends State<TransferCathayPayDetail> {
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
"เบอร์โทรศัพท์",
|
||||
"เบอร์โทรศัพท์".tr(),
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 14,
|
||||
@@ -216,7 +206,7 @@ class _TransferCathayPayDetailState extends State<TransferCathayPayDetail> {
|
||||
),
|
||||
Spacer(),
|
||||
Text(
|
||||
"089 - 108 - 0891",
|
||||
"",
|
||||
textAlign: TextAlign.right,
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
@@ -229,7 +219,7 @@ class _TransferCathayPayDetailState extends State<TransferCathayPayDetail> {
|
||||
height: 10,
|
||||
),
|
||||
Text(
|
||||
"จำนวนเงินที่โอน / จ่าย",
|
||||
"จำนวนเงินที่โอน / จ่าย".tr(),
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 16,
|
||||
@@ -249,7 +239,7 @@ class _TransferCathayPayDetailState extends State<TransferCathayPayDetail> {
|
||||
children: [
|
||||
Spacer(),
|
||||
Text(
|
||||
"5,000.00",
|
||||
"",
|
||||
textAlign: TextAlign.right,
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
@@ -266,7 +256,7 @@ class _TransferCathayPayDetailState extends State<TransferCathayPayDetail> {
|
||||
height: 10,
|
||||
),
|
||||
Text(
|
||||
"ใช้แต้ม NEO PAY แทนเงินสด",
|
||||
"ใช้แต้ม NEO PAY แทนเงินสด".tr(),
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 16,
|
||||
@@ -274,7 +264,7 @@ class _TransferCathayPayDetailState extends State<TransferCathayPayDetail> {
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"คะแนนของคุณ : 12,000 แต้ม",
|
||||
"${"คะแนนของคุณ".tr()} : 12,000 ${"แต้ม".tr()}",
|
||||
style: TextStyle(
|
||||
color: Color(0xff9d001b),
|
||||
fontSize: 14,
|
||||
@@ -284,7 +274,6 @@ class _TransferCathayPayDetailState extends State<TransferCathayPayDetail> {
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Container(
|
||||
width: 161,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
color: Color(0xfff2f2f2),
|
||||
@@ -299,7 +288,7 @@ class _TransferCathayPayDetailState extends State<TransferCathayPayDetail> {
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
"10 แต้ม",
|
||||
"10 ${"แต้ม".tr()}",
|
||||
textAlign: TextAlign.right,
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
@@ -332,7 +321,7 @@ class _TransferCathayPayDetailState extends State<TransferCathayPayDetail> {
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
"100 บาท",
|
||||
"100 ${"Baht".tr()}",
|
||||
textAlign: TextAlign.right,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
@@ -345,7 +334,7 @@ class _TransferCathayPayDetailState extends State<TransferCathayPayDetail> {
|
||||
),
|
||||
Center(
|
||||
child: Text(
|
||||
"1 แต้ม = 10 สตางค์",
|
||||
"1 แต้ม = 10 สตางค์".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
@@ -355,6 +344,8 @@ class _TransferCathayPayDetailState extends State<TransferCathayPayDetail> {
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: 136,
|
||||
color: Colors.transparent,
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
@@ -363,7 +354,7 @@ class _TransferCathayPayDetailState extends State<TransferCathayPayDetail> {
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
"ยอดเงินทั้งหมด",
|
||||
"ยอดเงินทั้งหมด".tr(),
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
fontSize: 16,
|
||||
@@ -371,7 +362,7 @@ class _TransferCathayPayDetailState extends State<TransferCathayPayDetail> {
|
||||
),
|
||||
Spacer(),
|
||||
Text(
|
||||
"4.990.00",
|
||||
"",
|
||||
textAlign: TextAlign.right,
|
||||
style: TextStyle(
|
||||
color: Color(0xff9d001b),
|
||||
@@ -380,7 +371,7 @@ class _TransferCathayPayDetailState extends State<TransferCathayPayDetail> {
|
||||
),
|
||||
),
|
||||
Text(
|
||||
" บาท",
|
||||
" ${"Baht".tr()}",
|
||||
textAlign: TextAlign.right,
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
@@ -406,36 +397,24 @@ class _TransferCathayPayDetailState extends State<TransferCathayPayDetail> {
|
||||
});
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: 51,
|
||||
decoration: BoxDecoration(
|
||||
child: SizedBox(
|
||||
width: double.infinity,
|
||||
child: Card(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(40),
|
||||
color: Color(0xff9d001b),
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
vertical: 12,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 106,
|
||||
height: 32,
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
child: Text(
|
||||
"ยืนยัน",
|
||||
"Confirm".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: GoogleFonts.kanit(
|
||||
color: Colors.white,
|
||||
color: ColorCustom.greyBorder,
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -444,8 +423,6 @@ class _TransferCathayPayDetailState extends State<TransferCathayPayDetail> {
|
||||
),
|
||||
],
|
||||
),
|
||||
height: 136,
|
||||
color: Colors.transparent,
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
|
||||
@@ -147,6 +147,7 @@ class _TransferMoneyMenuPageState extends State<TransferMoneyMenuPage> {
|
||||
InkWell(
|
||||
onTap: () {
|
||||
showModalBottomSheet<void>(
|
||||
useSafeArea: true,
|
||||
context: context,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.vertical(
|
||||
@@ -158,31 +159,6 @@ class _TransferMoneyMenuPageState extends State<TransferMoneyMenuPage> {
|
||||
});
|
||||
},
|
||||
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,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
@@ -193,7 +169,32 @@ class _TransferMoneyMenuPageState extends State<TransferMoneyMenuPage> {
|
||||
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(
|
||||
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(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
@@ -224,7 +237,7 @@ class _TransferMoneyMenuPageState extends State<TransferMoneyMenuPage> {
|
||||
width: 20,
|
||||
),
|
||||
Text(
|
||||
"บัญชีธนาคาร",
|
||||
"บัญชีธนาคาร".tr(),
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
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(
|
||||
@@ -588,7 +589,7 @@ class _TransferMoneyMenuPageState extends State<TransferMoneyMenuPage> {
|
||||
),
|
||||
Expanded(
|
||||
child: Text(
|
||||
"สแกน QR Code CATHAY PAY".tr(),
|
||||
"สแกน QR Code NEO PAY".tr(),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
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 '../api/api.dart';
|
||||
import '../utils/color_custom.dart';
|
||||
import 'TransferPromtptPayDialog.dart';
|
||||
|
||||
class TransferPromptPay extends StatefulWidget {
|
||||
@@ -96,36 +97,24 @@ class _TransferPromptPayState extends State<TransferPromptPay> {
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(left: 20, right: 20),
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: 51,
|
||||
decoration: BoxDecoration(
|
||||
width: double.infinity,
|
||||
margin: const EdgeInsets.symmetric(horizontal: 15),
|
||||
child: Card(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(40),
|
||||
color: Color(0xff9d001b),
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
vertical: 12,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 106,
|
||||
height: 32,
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
child: Text(
|
||||
"Next".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: GoogleFonts.kanit(
|
||||
color: Colors.white,
|
||||
color: ColorCustom.greyBorder,
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -418,36 +407,24 @@ class _TransferPromptPayDetailState extends State<TransferPromptPayDetail> {
|
||||
onTap: () async {
|
||||
initPromptPay(context);
|
||||
},
|
||||
child: Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: 51,
|
||||
decoration: BoxDecoration(
|
||||
child: SizedBox(
|
||||
width: double.infinity,
|
||||
child: Card(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(40),
|
||||
color: Color(0xff9d001b),
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
vertical: 12,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 106,
|
||||
height: 32,
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
child: Text(
|
||||
"Confirm".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: GoogleFonts.kanit(
|
||||
color: Colors.white,
|
||||
color: ColorCustom.greyBorder,
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -50,6 +50,9 @@ class Api {
|
||||
static String lockTest = BaseUrlBuilding + "api/V2/Authentication/LockUnlock";
|
||||
static String otp = "https://otp.thaibulksms.com/v2/otp/request";
|
||||
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 promotion = BaseUrlCathay + "common/promotion/";
|
||||
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 getTransaction = BaseUrlBuilding + "api/v2/Payment/getTransactionWeb";
|
||||
|
||||
static String BaseUrlBuildingCathay = "https://sathorn.cathay-pay.com/";
|
||||
static String payPromptPayInitial = BaseUrlBuildingCathay + "api/v2/EPaymentBBL/TransferedPromptPayIDInitial";
|
||||
static String payPromptPayConfirm = BaseUrlBuildingCathay + "api/v2/EPaymentBBL/TransferedPromptPayIDConfirm";
|
||||
static String payThaiInitial = BaseUrlBuildingCathay + "api/v2/EPaymentBBL/TransferedPromptPayQRInitial";
|
||||
static String payThaiConfirm = BaseUrlBuildingCathay + "api/v2/EPaymentBBL/TransferedPromptPayQRConfirm";
|
||||
// static String BaseUrlBuildingCathay = "https://sathorn.cathay-pay.com/";
|
||||
static String payPromptPayInitial = BaseUrlBuilding + "api/v2/EPaymentBBL/TransferedPromptPayIDInitial";
|
||||
static String payPromptPayConfirm = BaseUrlBuilding + "api/v2/EPaymentBBL/TransferedPromptPayIDConfirm";
|
||||
static String payThaiInitial = BaseUrlBuilding + "api/v2/EPaymentBBL/TransferedPromptPayQRInitial";
|
||||
static String payThaiConfirm = BaseUrlBuilding + "api/v2/EPaymentBBL/TransferedPromptPayQRConfirm";
|
||||
|
||||
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 {
|
||||
printLongString(jsonParam);
|
||||
try {
|
||||
@@ -371,7 +416,7 @@ class Api {
|
||||
printLongString(jsonParam);
|
||||
try {
|
||||
var response;
|
||||
if (tokenModel != null) {
|
||||
if (tokenAdmin != null) {
|
||||
Map<String, String> requestHeaders = {HttpHeaders.contentTypeHeader: "application/json", "Authorization": "Bearer $tokenAdmin"};
|
||||
response = await http.post(Uri.parse(url), body: jsonParam, headers: requestHeaders);
|
||||
} else {
|
||||
@@ -379,7 +424,7 @@ class Api {
|
||||
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) {
|
||||
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 black = Color(0xFF000000);
|
||||
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
|
||||
# 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.
|
||||
version: 1.0.0+2
|
||||
version: 1.0.2+8
|
||||
|
||||
environment:
|
||||
sdk: '>=2.19.3 <3.0.0'
|
||||
@@ -31,29 +31,33 @@ dependencies:
|
||||
http: any
|
||||
google_fonts: ^6.0.1
|
||||
camera: ^0.10.3+2
|
||||
pin_code_fields: ^7.4.0
|
||||
pin_code_fields: ^8.0.1
|
||||
shared_preferences: ^2.1.0
|
||||
path_provider: ^2.0.5
|
||||
image_picker: ^0.8.7+4
|
||||
intl: ^0.18.1
|
||||
intl: ^0.19.0
|
||||
font_awesome_flutter: ^10.4.0
|
||||
signature: ^5.4.0
|
||||
mime: ^1.0.4
|
||||
mime: ^2.0.0
|
||||
device_info_plus: ^9.0.2
|
||||
qr_code_scanner: ^1.0.1
|
||||
qr_flutter: ^4.1.0
|
||||
flutter_launcher_icons: ^0.13.1
|
||||
webview_flutter: ^4.4.2
|
||||
image_gallery_saver: ^2.0.3
|
||||
# image_gallery_saver: ^2.0.3
|
||||
pull_to_refresh_flutter3: ^2.0.2
|
||||
carousel_slider: ^4.2.1
|
||||
carousel_slider: ^5.0.0
|
||||
url_launcher: ^6.3.0
|
||||
package_info_plus: ^8.0.2
|
||||
mask_text_input_formatter: ^2.9.0
|
||||
currency_text_input_formatter: ^2.2.5
|
||||
screenshot: ^2.5.0
|
||||
screenshot: ^3.0.0
|
||||
easy_localization: ^3.0.7
|
||||
saver_gallery: ^4.0.0
|
||||
permission_handler: ^11.3.1
|
||||
|
||||
dependency_overrides:
|
||||
win32: ^5.5.4
|
||||
|
||||
flutter:
|
||||
sdk: flutter
|
||||
|
||||