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,5 +1,11 @@
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:saver_gallery/saver_gallery.dart';
import 'package:screenshot/screenshot.dart';
import '../utils/utils.dart';
class TransferCathayPayDialog extends StatefulWidget {
const TransferCathayPayDialog({Key? key}) : super(key: key);
@@ -9,9 +15,12 @@ class TransferCathayPayDialog extends StatefulWidget {
}
class _TransferCathayPayDialogState extends State<TransferCathayPayDialog> {
ScreenshotController screenshotController = ScreenshotController();
@override
Widget build(BuildContext context) {
return Padding(
return Screenshot(
controller: screenshotController,
child:Padding(
padding: const EdgeInsets.only(left: 20,right: 20),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
@@ -279,6 +288,55 @@ class _TransferCathayPayDialogState extends State<TransferCathayPayDialog> {
),
),
),
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,
),
),
),
],
),
),
),
],
),
),
@@ -288,6 +346,6 @@ class _TransferCathayPayDialogState extends State<TransferCathayPayDialog> {
),
]),
);
));
}
}