import 'package:cathaypay_mobile/Numpad.dart'; import 'package:cathaypay_mobile/PinCodeVadidate.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:google_fonts/google_fonts.dart'; class TransferBank extends StatefulWidget { const TransferBank({Key? key}) : super(key: key); @override State createState() => _TransferBankState(); } class _TransferBankState extends State { TextEditingController _phone = TextEditingController(); @override Widget build(BuildContext context) { return Padding( padding: const EdgeInsets.all(20.0), child: Column( children: [ Row( children: [ IconButton( onPressed: () { Navigator.of(context).pop(); }, icon: Icon( Icons.arrow_back_ios, color: Colors.black, )), Text( "โอนเงินผ่านธนาคาร", style: TextStyle( color: Color(0xff050505), fontSize: 20, ), ) ], ), Padding( padding: const EdgeInsets.all(10.0), child: Container( child: Row( children: [ Image( image: AssetImage('images/bank/krungthai.png'), fit: BoxFit.cover, ), SizedBox( width: 20, ), Text( "Krungthai Bank", style: TextStyle( color: Color(0xff050505), fontSize: 18, fontWeight: FontWeight.w300, ), ) ], ), height: 56, decoration: BoxDecoration( borderRadius: BorderRadius.circular(6), color: Colors.grey.shade100, ), ), ), Padding( padding: const EdgeInsets.all(10.0), child: InkWell( onTap: () { showModalBottomSheet( context: context, isScrollControlled: true, useSafeArea: true, shape: RoundedRectangleBorder( borderRadius: BorderRadius.vertical( top: Radius.circular(16), ), ), builder: (BuildContext context) { return TransferBankDetail(); }); }, child: Container( child: Row( children: [ Image( image: AssetImage('images/bank/kbank.png'), fit: BoxFit.cover, ), SizedBox( width: 20, ), Text( "KASIKORNBANK", style: TextStyle( color: Color(0xff050505), fontSize: 18, fontWeight: FontWeight.w300, ), ) ], ), height: 56, decoration: BoxDecoration( borderRadius: BorderRadius.circular(6), color: Colors.grey.shade100, ), ), ), ), Padding( padding: const EdgeInsets.all(10.0), child: InkWell( onTap: () { // showModalBottomSheet( // context: context, // isScrollControlled: true,useSafeArea: true, // builder: (BuildContext context) { // return SafeArea(child: TopUpAddBankDetail()); // }); }, child: Container( child: Row( children: [ Image( image: AssetImage('images/bank/scb.png'), fit: BoxFit.cover, ), SizedBox( width: 20, ), Text( "Siam Commercial Bank", style: TextStyle( color: Color(0xff050505), fontSize: 18, fontWeight: FontWeight.w300, ), ) ], ), height: 56, decoration: BoxDecoration( borderRadius: BorderRadius.circular(6), color: Colors.grey.shade100, ), ), ), ) ], ), ); } } class TransferBankDetail extends StatefulWidget { const TransferBankDetail({Key? key}) : super(key: key); @override State createState() => _TransferBankDetailState(); } class _TransferBankDetailState extends State { String number = ''; TextEditingController price = TextEditingController(); setValue(String val) { setState(() { price.text += val; }); } backspace(String text) { if (price.text.length > 0) { setState(() { price.text = price.text.substring(0, price.text.length - 1); }); } } @override Widget build(BuildContext context) { return Scaffold( body: SingleChildScrollView( child: Padding( padding: const EdgeInsets.all(20.0), child: Container( child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, children: [ Row( children: [ IconButton( onPressed: () { Navigator.of(context).pop(); }, icon: Icon( Icons.arrow_back_ios, color: Colors.black, )), Text( "โอนเงินผ่านธนาคาร", style: TextStyle( color: Color(0xff050505), fontSize: 20, ), ), Spacer(), IconButton( onPressed: () { Navigator.of(context).pop(); }, icon: Icon( Icons.close, color: Colors.black, )), ], ), Container( child: Row( children: [ Image( image: AssetImage('images/bank/kbank.png'), fit: BoxFit.cover, ), SizedBox( width: 20, ), Text( "KASIKORNBANK", style: TextStyle( color: Color(0xff050505), fontSize: 18, fontWeight: FontWeight.w300, ), ) ], ), height: 56, decoration: BoxDecoration( borderRadius: BorderRadius.circular(6), color: Colors.grey.shade100, ), ), Text( "หมายเลขบัญชี", style: TextStyle( color: Color(0xff65676b), fontSize: 16, fontWeight: FontWeight.w300, ), ), Container( child: Row( children: [ Spacer(), Text( "201-5-41801-9", textAlign: TextAlign.right, style: TextStyle( color: Color(0xff65676b), fontSize: 20, ), ), SizedBox( width: 20, ) ], ), height: 48, decoration: BoxDecoration( borderRadius: BorderRadius.circular(100), color: Color(0xfff2f2f2), ), ), Text( "จำนวนเงินที่โอน", style: TextStyle( color: Color(0xff65676b), fontSize: 16, fontWeight: FontWeight.w300, ), ), Container( child: Row( children: [ Spacer(), Text( "฿ 200.00", textAlign: TextAlign.right, style: TextStyle( color: Color(0xff65676b), fontSize: 36, ), ), SizedBox( width: 20, ) ], ), height: 66, decoration: BoxDecoration( borderRadius: BorderRadius.circular(100), color: Color(0xfff2f2f2), ), ), Container( // padding: EdgeInsets.symmetric(horizontal: 50.0), child: Column( children: [ Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ NumpadButton( text: '1', onPressed: () => setValue('1'), ), NumpadButton( text: '2', onPressed: () => setValue('2'), ), NumpadButton( text: '3', onPressed: () => setValue('2'), ), ], ), Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ NumpadButton( text: '4', onPressed: () => setValue('4'), ), NumpadButton( text: '5', onPressed: () => setValue('5'), ), NumpadButton( text: '6', onPressed: () => setValue('6'), ), ], ), Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ NumpadButton( text: '7', onPressed: () => setValue('7'), ), NumpadButton( text: '8', onPressed: () => setValue('8'), ), NumpadButton( text: '9', onPressed: () => setValue('9'), ), ], ), Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ Container( padding: EdgeInsets.symmetric(vertical: 10.0), child: OutlinedButton( style: OutlinedButton.styleFrom( side: BorderSide.none, backgroundColor: Colors.transparent, ), onPressed: () {}, child: Padding( padding: EdgeInsets.all(20.0), child: Text( "0", style: GoogleFonts.kanit( color: Colors.transparent, fontSize: 30, fontWeight: FontWeight.w500, ), ), ), ), ), NumpadButton( text: '0', onPressed: () => setValue('0'), ), NumpadButton( haveBorder: false, icon: Icons.backspace, onPressed: () => backspace(number), ), ], ) ], ), ), InkWell( onTap: () async { showModalBottomSheet( context: context, isScrollControlled: true, useSafeArea: true, shape: RoundedRectangleBorder( borderRadius: BorderRadius.vertical( top: Radius.circular(16), ), ), builder: (BuildContext context) { return TransferBankConfirm(); }); // final result = await Navigator.push( // context, // MaterialPageRoute( // builder: (context) => PinCodeValidatePage()), // ); // if (result == true) { // showDialog( // context: context, // builder: (BuildContext context) { // return TransferBankDialog(); // }); // } }, child: Container( width: MediaQuery.of(context).size.width, height: 51, decoration: BoxDecoration( borderRadius: BorderRadius.circular(40), color: Color(0xff9d001b), ), padding: const EdgeInsets.symmetric( horizontal: 10, vertical: 12, ), child: Row( mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ SizedBox( width: 106, height: 32, child: Text( "ยืนยัน", textAlign: TextAlign.center, style: GoogleFonts.kanit( color: Colors.white, fontSize: 20, fontWeight: FontWeight.w500, ), ), ), ], ), ), ), SizedBox( height: 10, ), ], ), ), ), )); } } class TransferBankConfirm extends StatefulWidget { const TransferBankConfirm({Key? key}) : super(key: key); @override State createState() => _TransferBankConfirmState(); } class _TransferBankConfirmState extends State { @override Widget build(BuildContext context) { return Padding( padding: const EdgeInsets.all(20.0), child: Column(children: [ Row(children: [ IconButton( onPressed: () { Navigator.of(context).pop(); }, icon: Icon( Icons.arrow_back_ios, color: Colors.black, )), Text( "โอนเงินผ่านธนาคาร", style: TextStyle( color: Color(0xff050505), fontSize: 20, ), ), Spacer(), IconButton( onPressed: () { Navigator.of(context).pop(); }, icon: Icon( Icons.close, color: Colors.black, )), ]), Container( width: 262.83, height: 147.89, child: Image( image: AssetImage('images/neopay_logo.png'), ), ), Padding( padding: const EdgeInsets.symmetric(horizontal: 20), child: SingleChildScrollView( child: Column(mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center, children: [ Card(color: Color(0xfffbfbfb),child: Padding( padding: const EdgeInsets.all(10.0), child: Column(children: [ Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( "เลขที่บิล", style: TextStyle( color: Color(0xff65676b), fontSize: 16, fontWeight: FontWeight.w300, ), ), Text( "0158987", style: TextStyle( color: Color(0xff65676b), fontSize: 16, fontWeight: FontWeight.w300, ), ) ], ), SizedBox( height: 15, ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( "เวลา", style: TextStyle( color: Color(0xff65676b), fontSize: 16, fontWeight: FontWeight.w300, ), ), Text( "27-11-2563 11:56", style: TextStyle( color: Color(0xff65676b), fontSize: 16, fontWeight: FontWeight.w300, ), ) ], ), SizedBox( height: 30, ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( "จาก", style: TextStyle( color: Color(0xff65676b), fontSize: 16, fontWeight: FontWeight.w300, ), ), Text( "นางสาวต้นหอม สุขสมหวัง", style: TextStyle( color: Color(0xff65676b), fontSize: 16, fontWeight: FontWeight.w600, ), ) ], ), SizedBox( height: 15, ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( "", style: TextStyle( color: Color(0xff65676b), fontSize: 16, fontWeight: FontWeight.w300, ), ), Text( "1101852034020", style: TextStyle( color: Color(0xff65676b), fontSize: 16, fontWeight: FontWeight.w300, ), ) ], ), SizedBox( height: 35, ), Row( children: [ Text( "ถึง", style: TextStyle( color: Color(0xff65676b), fontSize: 16, fontWeight: FontWeight.w300, ), ),Spacer(), Container( height: 20, width: 20, child: Image.asset( 'images/bank/kbank.png', )), Text( "นางสาว กมลรวี กอสัมพันธ์", style: TextStyle( color: Color(0xff65676b), fontSize: 16, fontWeight: FontWeight.w600, ), ) ], ), SizedBox( height: 15, ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( "", style: TextStyle( color: Color(0xff65676b), fontSize: 16, fontWeight: FontWeight.w300, ), ), Text( "201-5-41801-9", style: TextStyle( color: Color(0xff65676b), fontSize: 16, fontWeight: FontWeight.w300, ), ) ], ), Padding( padding: const EdgeInsets.symmetric(vertical: 20), child: Divider( color: Color.fromRGBO(101, 103, 107, 1), thickness: 0.4000000059604645 ), ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( "จำนวนเงิน", style: TextStyle( color: Color(0xff65676b), fontSize: 16, fontWeight: FontWeight.w300, ), ), Text( "฿ 200.00", style: TextStyle( color: Color(0xff65676b), fontSize: 20, fontWeight: FontWeight.w800, ), ) ], ), SizedBox(height: 20,), ],), ),), SizedBox(height: 20,), Row(mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ InkWell( onTap: () { } , child: Container( margin: EdgeInsets.only(bottom: 15), width: MediaQuery.of(context).size.width/4, height: 46, decoration: BoxDecoration( borderRadius: BorderRadius.circular(100), color: Color(0xff2d2d2d) , ), child: Center( child: Text( "ยกเลิก", textAlign: TextAlign.center, style: TextStyle( color: Colors.white, fontSize: 18, fontWeight: FontWeight.w300, ), )), )), InkWell( onTap: () async { final result = await Navigator.push( context, MaterialPageRoute( builder: (context) => PinCodeValidatePage()), ); if (result == true) { showDialog( context: context, builder: (BuildContext context) { return TransferBankDialog(); }); } } , child: Container( margin: EdgeInsets.only(bottom: 15), width: MediaQuery.of(context).size.width/4, height: 46, decoration: BoxDecoration( borderRadius: BorderRadius.circular(100), color: Color(0xffad022c) , ), child: Center( child: Text( "ตกลง", textAlign: TextAlign.center, style: TextStyle( color: Colors.white, fontSize: 18, fontWeight: FontWeight.w300, ), )), )), ], ) ]), )) ])); } } class TransferBankDialog extends StatefulWidget { const TransferBankDialog({Key? key}) : super(key: key); @override State createState() => _TransferBankDialogState(); } class _TransferBankDialogState extends State { @override Widget build(BuildContext context) { return Padding( padding: const EdgeInsets.fromLTRB(20, 0, 20, 0), child: Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ Card(color: Color(0xfffbfbfb),child: Padding( padding: const EdgeInsets.all(10.0), child: Column(children: [ Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( "เลขที่บิล", style: TextStyle( color: Color(0xff65676b), fontSize: 16, fontWeight: FontWeight.w300, ), ), Text( "0158987", style: TextStyle( color: Color(0xff65676b), fontSize: 16, fontWeight: FontWeight.w300, ), ) ], ), SizedBox( height: 15, ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( "เวลา", style: TextStyle( color: Color(0xff65676b), fontSize: 16, fontWeight: FontWeight.w300, ), ), Text( "27-11-2563 11:56", style: TextStyle( color: Color(0xff65676b), fontSize: 16, fontWeight: FontWeight.w300, ), ) ], ), SizedBox( height: 30, ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( "จาก", style: TextStyle( color: Color(0xff65676b), fontSize: 16, fontWeight: FontWeight.w300, ), ), Text( "นางสาวต้นหอม สุขสมหวัง", style: TextStyle( color: Color(0xff65676b), fontSize: 16, fontWeight: FontWeight.w600, ), ) ], ), SizedBox( height: 15, ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( "", style: TextStyle( color: Color(0xff65676b), fontSize: 16, fontWeight: FontWeight.w300, ), ), Text( "1101852034020", style: TextStyle( color: Color(0xff65676b), fontSize: 16, fontWeight: FontWeight.w300, ), ) ], ), SizedBox( height: 35, ), Row( children: [ Text( "ถึง", style: TextStyle( color: Color(0xff65676b), fontSize: 16, fontWeight: FontWeight.w300, ), ),Spacer(), Container( height: 20, width: 20, child: Image.asset( 'images/bank/kbank.png', )), Text( "นางสาว กมลรวี กอสัมพันธ์", style: TextStyle( color: Color(0xff65676b), fontSize: 16, fontWeight: FontWeight.w600, ), ) ], ), SizedBox( height: 15, ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( "", style: TextStyle( color: Color(0xff65676b), fontSize: 16, fontWeight: FontWeight.w300, ), ), Text( "201 - 5 -41801 - 9", style: TextStyle( color: Color(0xff65676b), fontSize: 16, fontWeight: FontWeight.w300, ), ) ], ), Padding( padding: const EdgeInsets.symmetric(vertical: 20), child: Divider( color: Color.fromRGBO(101, 103, 107, 1), thickness: 0.4000000059604645 ), ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( "จำนวนเงิน", style: TextStyle( color: Color(0xff65676b), fontSize: 16, fontWeight: FontWeight.w300, ), ), Text( "฿ 200", style: TextStyle( color: Color(0xff65676b), fontSize: 20, fontWeight: FontWeight.w800, ), ) ], ), SizedBox(height: 20,), InkWell( onTap: () { Navigator.popUntil(context, ModalRoute.withName('/HomePage')); } , child: Container( margin: EdgeInsets.only(bottom: 15), width: MediaQuery.of(context).size.width, height: 46, decoration: BoxDecoration( borderRadius: BorderRadius.circular(100), color: Color(0xffad022c) , ), child: Center( child: Text( "ปิด", textAlign: TextAlign.center, style: TextStyle( color: Colors.white, fontSize: 18, fontWeight: FontWeight.w300, ), )), )) ],), ),), SizedBox(height: 20,), ])); } }