Files
Neo_wallet/neowallet_mobile/lib/Withdraw/WithDrawDialog.dart
nutchayut 820cd73b88 bug fixed
2025-01-08 21:57:03 +07:00

211 lines
8.5 KiB
Dart

import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:intl/intl.dart';
import 'package:saver_gallery/saver_gallery.dart';
import 'package:screenshot/screenshot.dart';
import '../utils/utils.dart';
class WithDrawDialog extends StatefulWidget {
WithDrawDialog({Key? key}) : super(key: key);
@override
State<WithDrawDialog> createState() => _WithDrawDialogState();
}
class _WithDrawDialogState extends State<WithDrawDialog> {
ScreenshotController screenshotController = ScreenshotController();
@override
Widget build(BuildContext context) {
return AlertDialog(
title: Screenshot(
controller: screenshotController,
child:Container(
child: Padding(
padding: const EdgeInsets.all(0.0),
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
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,
),
)
],
),
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(
"${DateFormat("yyyy-MM-dd").format(DateTime.now())}",
style: TextStyle(
color: Color(0xff65676b),
fontSize: 16,
fontWeight: FontWeight.w300,
),
)
],
),
Text(
"ช่องทางการเติมเงิน",
style: TextStyle(
color: Color(0xff050505),
fontSize: 16,
),
),
Row(
children: [
Container(
width: 70,
height: 70,
child: Image(
image: AssetImage('images/bank/kbank.png'),
fit: BoxFit.cover,
),
),
Spacer(),
Text(
"015-5-40141-2",
textAlign: TextAlign.right,
style: TextStyle(
color: Color(0xff050505),
fontSize: 20,
),
)
],
),
Padding(
padding: const EdgeInsets.symmetric(vertical: 10),
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(
"500",
style: TextStyle(
color: Color(0xff65676b),
fontSize: 20,
fontWeight: FontWeight.w800,
),
)
],
),
SizedBox(
height: 20,
),
InkWell(
onTap: () async {
screenshotController
.capture(delay: Duration(milliseconds: 10))
.then((capturedImage) async {
String fileName = "neopay_${DateTime.now().millisecondsSinceEpoch}.jpg";
SaverGallery.saveImage(capturedImage!, fileName: fileName, skipIfExists: false);
Utils.showAlertDialog(context, "บันทึกสำเร็จ");
}).catchError((onError) {
print(onError);
});
Navigator.popUntil(
context, ModalRoute.withName('/HomePage'));
},
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(
"บันทึกและปิด".tr(),
textAlign: TextAlign.center,
style: GoogleFonts.kanit(
color: Colors.white,
fontSize: 20,
fontWeight: FontWeight.w500,
),
),
),
],
),
),
),
])))));
}
}