bug fixed

This commit is contained in:
nutchayut
2025-01-07 15:02:31 +07:00
parent f16e5f491a
commit 4f344e5e00
2634 changed files with 46314 additions and 9884 deletions

View File

@@ -1,6 +1,10 @@
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 {
@@ -12,11 +16,14 @@ class WithDrawDialog extends StatefulWidget {
}
class _WithDrawDialogState extends State<WithDrawDialog> {
ScreenshotController screenshotController = ScreenshotController();
@override
Widget build(BuildContext context) {
return AlertDialog(
title: Container(
title: Screenshot(
controller: screenshotController,
child:Container(
child: Padding(
padding: const EdgeInsets.all(0.0),
child: Column(
@@ -186,6 +193,55 @@ class _WithDrawDialogState extends State<WithDrawDialog> {
),
),
),
]))));
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);
});
},
child: Container(
margin: EdgeInsets.only(top: 20, bottom: 20),
width: MediaQuery
.of(context)
.size
.width,
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,
),
),
),
],
),
),
),
])))));
}
}