Files
Neo_wallet/neowallet_mobile/lib/TransferMoney/TransferPromtptPayDialog.dart
Manasit.K 43c32ef6cf init
2024-10-31 15:57:57 +07:00

256 lines
9.0 KiB
Dart

import 'package:cathaypay_mobile/Home/HomePage.dart';
import 'package:cathaypay_mobile/utils/utils.dart';
import 'package:flutter/material.dart';
import '../api/api.dart';
import '../model/profile_model.dart';
class TransferPromtptPayDialog extends StatefulWidget {
const TransferPromtptPayDialog({Key? key, required this.name, required this.phone, required this.price, required this.bill}) : super(key: key);
final String name;
final String phone;
final String price;
final String bill;
@override
State<TransferPromtptPayDialog> createState() => _TransferPromtptPayDialogState();
}
class _TransferPromtptPayDialogState extends State<TransferPromtptPayDialog> {
@override
void initState() {
getProfile(context);
super.initState();
}
getProfile(BuildContext context) {
Api.get(context, Api.profile).then((value) => {
if (value != null) {profile = Profile.fromJson(value["profile"])} else {}
});
}
@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(15.0),
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"เลขที่บิล",
style: TextStyle(
color: Color(0xff65676b),
fontSize: 16,
fontWeight: FontWeight.w300,
),
),
Expanded(
child: Text(
widget.bill,
style: TextStyle(
color: Color(0xff65676b),
fontSize: 16,
fontWeight: FontWeight.w300,
),
textAlign: TextAlign.end,
),
)
],
),
SizedBox(
height: 15,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"เวลา",
style: TextStyle(
color: Color(0xff65676b),
fontSize: 16,
fontWeight: FontWeight.w300,
),
),
Text(
Utils.getDateTimeCreate(),
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(
profile?.fullName ?? "",
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(
profile?.phoneNumber ?? "",
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: Icon(
Icons.phone_iphone,
color: Color(0xff65676b),
)),
Text(
widget.name,
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(
widget.phone,
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(
"฿ ${widget.price}",
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,
),
]));
}
}