Files
Neo_wallet/neowallet_mobile/lib/Withdraw/WithDrawDialog.dart
nutchayut b9ec3e6104 bug fixed
2025-01-09 23:50:38 +07:00

201 lines
8.0 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/color_custom.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: SizedBox(
width: double.infinity,
child: Card(
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(40),
),
child: Container(
padding: EdgeInsets.all(10),
child: Text(
"บันทึกและปิด".tr(),
textAlign: TextAlign.center,
style: GoogleFonts.kanit(
color: ColorCustom.greyBorder,
fontSize: 20,
fontWeight: FontWeight.w500,
),
),
),
),
)
),
])))));
}
}