bug fixed

This commit is contained in:
nutchayut
2025-01-07 15:02:31 +07:00
parent f16e5f491a
commit 4f344e5e00
2634 changed files with 46314 additions and 9884 deletions

View File

@@ -0,0 +1,157 @@
import 'package:cathaypay_mobile/Home/all_menu.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:cathaypay_mobile/PinCode.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/cupertino.dart';
import 'dart:convert';
import 'dart:io';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import '../utils/color_custom.dart';
TextEditingController _current_email = TextEditingController();
TextEditingController _new_email = TextEditingController();
class ChangeEmailPage extends StatefulWidget {
const ChangeEmailPage({super.key});
@override
State<ChangeEmailPage> createState() => _ChangeEmailPageState();
}
class _ChangeEmailPageState extends State<ChangeEmailPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
// extendBodyBehindAppBar: true,
appBar: AppBar(
backgroundColor: Colors.white,
leading: CupertinoButton(
onPressed: () {
Navigator.pop(context);
},
child: const Icon(
Icons.arrow_back,
color: Colors.black54,
),
),
elevation: 0,
centerTitle: true,
title: Text(
"เปลี่ยนอีเมล".tr(),
textAlign: TextAlign.center,
style: GoogleFonts.kanit(
color: Colors.black,
fontSize: 20,
),
),
),
body: SafeArea(
child: Padding(
padding: const EdgeInsets.all(20.0),
child: Container(height: MediaQuery.of(context).size.height,
child: Column(mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.start, children: [
SizedBox(
height: 10,
),
Text(
"อีเมลปัจจุบัน".tr(),
style: GoogleFonts.kanit(
color: Color(0xff565656),
fontSize: 15,
),
),
SizedBox(
height: 10,
),
Container(
child: TextField(
keyboardType: TextInputType.emailAddress,
// inputFormatters: [
// FilteringTextInputFormatter.allow(RegExp(r'[0-9]')),
// ],
controller: _current_email,
decoration: InputDecoration(
// hintText: 'อีเมลปัจจุบัน'.tr(),
border: InputBorder.none,
contentPadding: EdgeInsets.symmetric(horizontal: 16),
),
),
// margin: EdgeInsets.symmetric(horizontal: 20),
height: 48,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(100),
color: Color(0xfff2f2f2),
),
),
SizedBox(
height: 10,
),
Text(
"อีเมลใหม่".tr(),
style: GoogleFonts.kanit(
color: Color(0xff565656),
fontSize: 15,
),
),
SizedBox(
height: 10,
),
Container(
child: TextField(
keyboardType: TextInputType.emailAddress,
// inputFormatters: [
// FilteringTextInputFormatter.allow(RegExp(r'[0-9]')),
// ],
controller: _new_email,
decoration: InputDecoration(
// hintText: 'อีเมลปัจจุบัน'.tr(),
border: InputBorder.none,
contentPadding: EdgeInsets.symmetric(horizontal: 16),
),
),
// margin: EdgeInsets.symmetric(horizontal: 20),
height: 48,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(100),
color: Color(0xfff2f2f2),
),
),
Spacer(),
// Expanded(child: Container()),
InkWell(
onTap: () async {
// initPromptPay(context);
},
child: Container(
width: double.infinity,
child: Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(40),
),
child: Container(
padding: EdgeInsets.all(10),
child: Text(
"Confirm".tr(),
textAlign: TextAlign.center,
style: GoogleFonts.kanit(
color: ColorCustom.greyBorder,
fontSize: 20,
fontWeight: FontWeight.w500,
),
),
),
),
),
)
]),
))));
}
}

View File

@@ -24,6 +24,7 @@ import '../model/promotion_model.dart';
import '../model/token_model.dart';
import '../utils/color_custom.dart';
import '../utils/utils.dart';
import 'Setting.dart';
Profile? profile;
String tokenAdmin = "";
@@ -226,16 +227,9 @@ class _HomePageState extends State<HomePage> {
@override
Widget build(BuildContext context) {
return PopScope(
canPop: _canPop, // <== set a bool var or set it to false
onPopInvoked: (bool didPop) async {
if (didPop) {
return;
}
if (Navigator.of(context).canPop()) {
Navigator.of(context).pop(context);
}
},
child: Scaffold(
canPop: false,
child: Scaffold(
body: SafeArea(
child: SmartRefresher(
onRefresh: () {
@@ -265,6 +259,23 @@ class _HomePageState extends State<HomePage> {
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.end,
children: [
InkWell(
onTap: () {
showModalBottomSheet<void>(
context: context,
isScrollControlled: true,
useSafeArea: true,
builder: (BuildContext context) {
return SettingPage();
});
// clearProfile();
},
child: Icon(
Icons.settings,
size: 20,
color: Colors.white,
),
),
InkWell(
onTap: () {

View File

@@ -0,0 +1,179 @@
import 'package:cathaypay_mobile/Pay/QrScanDialog.dart';
import 'package:cathaypay_mobile/Pay/ThaiQrDialog.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:google_fonts/google_fonts.dart';
import '../Home/home_bottom_menu_widget.dart';
import '../Pay/PayPromptPay.dart';
import '../TransferMoney/TransferPromptPay.dart';
import '../TransferMoney/transfer_history.dart';
import 'ChangeEmail.dart';
class SettingPage extends StatefulWidget {
const SettingPage({Key? key}) : super(key: key);
@override
State<SettingPage> createState() => _SettingPageState();
}
class _SettingPageState extends State<SettingPage> {
@override
void initState() {
super.initState();
}
// {
// "MobileDeviceNo": "string", "TransactionID": "string", "Amount": 0,
// "Note": "string"
// }
var isReturn = false;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.transparent,
flexibleSpace: Image(
image: AssetImage('images/home/Head.png'),
fit: BoxFit.cover,
),
leading: CupertinoButton(
onPressed: () {
Navigator.pop(context);
},
child: const Icon(
Icons.chevron_left,
color: Colors.white,
),
),
elevation: 0,
title: Text(
"ตั้งค่า".tr(),
textAlign: TextAlign.center,
style: GoogleFonts.kanit(
color: Colors.white,
fontSize: 20,
),
),
),
body: Container(
width: MediaQuery.of(context).size.width,
child: Column(
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 20),
child: Column(
children: [
SizedBox(
height: 20,
),
InkWell(
onTap: () {
// Navigator.popUntil(context, ModalRoute.withName('/'));
// Navigator.pushNamed(context, '/HomePage');
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => ChangeEmailPage(),
),
);
},
child: Container(
height: 48,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(100),
boxShadow: [
BoxShadow(
color: Color(0x26000000),
blurRadius: 2,
offset: Offset(0.75, 1.50),
),
],
color: Color(0xfffbfbfb),
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(
width: 20,
),
Text(
"เปลี่ยนอีเมล".tr(),
style: TextStyle(
color: Color(0xff65676b),
fontSize: 20,
fontWeight: FontWeight.w500,
),
),
Spacer(),
],
),
),
),
SizedBox(
height: 20,
),
InkWell(
onTap: () {
showModalBottomSheet<void>(
context: context,
isScrollControlled: true,
useSafeArea: true,
builder: (BuildContext context) {
return ThaiQrDialog();
});
},
child: Container(
height: 48,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(100),
boxShadow: [
BoxShadow(
color: Color(0x26000000),
blurRadius: 2,
offset: Offset(0.75, 1.50),
),
],
color: Color(0xfffbfbfb),
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(
width: 20,
),
Text(
"เปลี่ยนรหัสผ่าน".tr(),
style: TextStyle(
color: Color(0xff65676b),
fontSize: 20,
fontWeight: FontWeight.w500,
),
),
Spacer(),
],
),
),
),
],
),
),
Expanded(child: Container()),
HomeBottomMenuWidget()
],
),
),
);
}
}