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

139 lines
4.8 KiB
Dart

import 'package:cathaypay_mobile/model/qrcode.dart';
import 'package:cathaypay_mobile/utils/utils.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:qr_flutter/qr_flutter.dart';
import '../Home/HomePage.dart';
class GetPaidDialog extends StatefulWidget {
const GetPaidDialog({Key? key, required this.qrCodeModel, required this.price}) : super(key: key);
final QrCodeModel qrCodeModel;
final int price;
@override
State<GetPaidDialog> createState() => _GetPaidDialogState();
}
class _GetPaidDialogState extends State<GetPaidDialog> {
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.only(left: 20, right: 20),
child: Column(mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [
// Container(
// margin: EdgeInsets.only(bottom: 10),
// height: 80,
// width: 80,
// child: Image.asset(
// 'assets/images/LOGO.gif',
// height: 120,
// width: 120,
// )),
Card(
color: Color(0xfffbfbfb),
child: Padding(
padding: const EdgeInsets.all(10.0),
child: Column(
children: [
Row(
children: [
Text(
"แสดง QR Code เพื่อรับเงิน",
style: TextStyle(
color: Colors.black,
fontSize: 20,
),
),
Spacer(),
IconButton(
onPressed: () {
Navigator.popUntil(context, ModalRoute.withName('/HomePage'));
},
icon: const Icon(
Icons.clear,
color: Colors.grey,
),
)
],
),
Padding(
padding: const EdgeInsets.all(20.0),
child: QrImageView(
data: '${widget.qrCodeModel.qrText}|${profile?.phoneNumber}|${profile?.fullName}',
version: QrVersions.auto,
size: 200.0,
),
),
Row(
children: [
Text(
"จำนวนเงินที่จะได้รับ",
textAlign: TextAlign.justify,
style: TextStyle(
color: Color(0xff65676b),
fontSize: 16,
),
),
Spacer(),
Text(
"฿ ${Utils.moneyFormat(widget.price)}",
textAlign: TextAlign.right,
style: TextStyle(
color: Color(0xff2d2d2d),
fontSize: 20,
),
)
],
),
InkWell(
onTap: () async {
Navigator.popUntil(context, ModalRoute.withName('/HomePage'));
},
child: Container(
margin: EdgeInsets.only(top: 20, bottom: 20),
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: 20,
),
]),
);
}
}