import 'package:cathaypay_mobile/TransferMoney/TransferCathayPay.dart'; import 'package:cathaypay_mobile/TransferMoney/transfer_history.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 '../Pay/QrScanDialog.dart'; import '../Pay/ThaiQrDialog.dart'; class TransferMoneyMenuPage extends StatefulWidget { const TransferMoneyMenuPage({Key? key}) : super(key: key); @override State createState() => _TransferMoneyMenuPageState(); } class _TransferMoneyMenuPageState extends State { bool _keyboardIsVisible = false; bool _is_history = false; @override Widget build(BuildContext context) { return GestureDetector( behavior: HitTestBehavior.opaque, onTap: () { // Hide the keyboard when the user taps outside of it FocusScope.of(context).unfocus(); }, child: Scaffold( resizeToAvoidBottomInset: false, 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( "Transfer Money".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.only(top: 15), child: Row( mainAxisAlignment: MainAxisAlignment.spaceAround, crossAxisAlignment: CrossAxisAlignment.start, children: [ InkWell( onTap: () { setState(() { _is_history = false; }); }, child: Column( children: [ Text( "Create Transaction".tr(), style: GoogleFonts.kanit( color: Colors.black, fontSize: 14, fontWeight: FontWeight.w300, ), ), Container( width: 63, height: 2, decoration: BoxDecoration( border: Border.all( color: _is_history ? Colors.transparent : Color(0xffd0315a), width: 2, ), ), ) ], ), ), InkWell( onTap: () { setState(() { _is_history = true; }); }, child: Column( children: [ Text( "Transaction History".tr(), style: GoogleFonts.kanit( color: Color(0xff565656), fontSize: 14, fontWeight: FontWeight.w300, ), ), Container( width: 63, height: 2, decoration: BoxDecoration( border: Border.all( color: _is_history ? Color(0xffd0315a) : Colors.transparent, width: 2, ), ), ) ], ), ), ], ), ), Divider( color: Color.fromRGBO(196, 196, 196, 1), thickness: 1, height: 1, ), _is_history ? TransferHistory() : Padding( padding: const EdgeInsets.symmetric(horizontal: 20), child: Column( mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ SizedBox( height: 20, ), InkWell( onTap: () { showModalBottomSheet( context: context, shape: RoundedRectangleBorder( borderRadius: BorderRadius.vertical( top: Radius.circular(16), ), ), builder: (BuildContext context) { return TransferCathayPay(); }); }, 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), boxShadow: [ BoxShadow( color: Color(0x26000000), blurRadius: 2, offset: Offset(0.75, 1.50), ), ], color: Color(0xffd0315a), ), ), ), SizedBox( height: 20, ), InkWell( onTap: () { // showModalBottomSheet( // context: context, // isScrollControlled: true, // useSafeArea: true, // shape: RoundedRectangleBorder( // borderRadius: BorderRadius.vertical( // top: Radius.circular(16), // ), // ), // builder: (BuildContext context) { // return TransferBank(); // }); }, child: Container( child: Row( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, children: [ SizedBox( width: 20, ), Text( "บัญชีธนาคาร", style: TextStyle( color: Color(0xff65676b), fontSize: 20, fontWeight: FontWeight.w500, ), ), Spacer(), FaIcon( FontAwesomeIcons.bank, color: Color(0xff65676b), ), SizedBox( width: 20, ), ], ), 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( height: 20, ), /* InkWell( onTap: () { showModalBottomSheet( context: context, isScrollControlled: true, shape: RoundedRectangleBorder( borderRadius: BorderRadius.vertical( top: Radius.circular(16), ), ), builder: (BuildContext context) { return Padding( padding: MediaQuery.of(context).viewInsets, child: TransferPromptPay(), ); }); }, child: Container( child: Row( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, children: [ SizedBox( width: 20, ), Text( "PromptPay".tr(), style: TextStyle( color: Color(0xff65676b), fontSize: 20, fontWeight: FontWeight.w500, ), ), Spacer(), Container( width: 66, height: 39, child: Image( image: AssetImage('images/prompt.png'), fit: BoxFit.cover, ), ), SizedBox( width: 20, ), ], ), height: 48, decoration: BoxDecoration( borderRadius: BorderRadius.circular(100), boxShadow: [ BoxShadow( color: Color(0x26000000), blurRadius: 2, offset: Offset(0.75, 1.50), ), ], color: Color(0xfffbfbfb), ), ), ), SizedBox( height: 20, ), InkWell( onTap: () { showModalBottomSheet( context: context, isScrollControlled: true, useSafeArea: true, shape: RoundedRectangleBorder( borderRadius: BorderRadius.vertical( top: Radius.circular(16), ), ), builder: (BuildContext context) { return PayPage(); }); }, 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( "Scan via QR code".tr(), style: TextStyle( color: Color(0xff65676b), fontSize: 20, fontWeight: FontWeight.w500, ), ), Spacer(), FaIcon( FontAwesomeIcons.qrcode, color: Color(0xff65676b), ), SizedBox( width: 20, ), ], ), ), ), SizedBox( height: 20, ), InkWell( onTap: () { showModalBottomSheet( context: context, isScrollControlled: true, useSafeArea: true, shape: RoundedRectangleBorder( borderRadius: BorderRadius.vertical( top: Radius.circular(16), ), ), builder: (BuildContext context) { return TransferWorldPage(); }); }, child: Container( child: Row( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, children: [ SizedBox( width: 20, ), Text( "โอนเงินต่างประเทศ", style: TextStyle( color: Color(0xff65676b), fontSize: 20, fontWeight: FontWeight.w500, ), ), Spacer(), Icon( Icons.public, color: Color(0xff65676b), ), SizedBox( width: 20, ), ], ), height: 48, decoration: BoxDecoration( borderRadius: BorderRadius.circular(100), boxShadow: [ BoxShadow( color: Color(0x26000000), blurRadius: 2, offset: Offset(0.75, 1.50), ), ], color: Color(0xfffbfbfb), ), ), )*/ InkWell( onTap: () { showModalBottomSheet( context: context, isScrollControlled: true, shape: RoundedRectangleBorder( borderRadius: BorderRadius.vertical( top: Radius.circular(16), ), ), builder: (BuildContext context) { return Padding( padding: MediaQuery.of(context).viewInsets, child: PayPromptPay(), ); }); }, 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( "PromptPay".tr(), style: TextStyle( color: Color(0xff65676b), fontSize: 20, fontWeight: FontWeight.w500, ), ), Spacer(), Container( width: 66, height: 39, child: Image( image: AssetImage('images/prompt.png'), fit: BoxFit.cover, ), ), SizedBox( width: 20, ), ], ), ), ), SizedBox( height: 20, ), InkWell( onTap: () { showModalBottomSheet( 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( "สแกน Thai QR Code".tr(), style: TextStyle( color: Color(0xff65676b), fontSize: 20, fontWeight: FontWeight.w500, ), ), Spacer(), Container( width: 66, height: 39, child: Image( image: AssetImage('images/ci-qrpayment-img-01.png'), fit: BoxFit.cover, ), ), SizedBox( width: 20, ), ], ), ), ), SizedBox( height: 20, ), InkWell( onTap: () { showModalBottomSheet( context: context, isScrollControlled: true, useSafeArea: true, builder: (BuildContext context) { return QrScanDialog(); }); }, 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, ), Expanded( child: Text( "สแกน QR Code CATHAY PAY".tr(), maxLines: 1, overflow: TextOverflow.ellipsis, style: TextStyle( color: Color(0xff65676b), fontSize: 20, fontWeight: FontWeight.w500, ), ), ), Container( width: 30, height: 30, child: Image( image: AssetImage('images/image qr.png'), fit: BoxFit.fill, ), ), SizedBox( width: 20, ), ], ), ), ), SizedBox( height: 20, ), ], ), ), Expanded(child: Container()), HomeBottomMenuWidget() ], ), ), )); } }