bug fixed
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:cathaypay_mobile/Home/HomePage.dart';
|
||||
import 'package:cathaypay_mobile/utils/utils.dart';
|
||||
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 '../api/api.dart';
|
||||
import '../model/profile_model.dart';
|
||||
@@ -41,6 +45,7 @@ class PayQrDialogV2 extends StatefulWidget {
|
||||
|
||||
class _PayQrDialogV2State extends State<PayQrDialogV2> {
|
||||
@override
|
||||
ScreenshotController screenshotController = ScreenshotController();
|
||||
void initState() {
|
||||
getProfile(context);
|
||||
super.initState();
|
||||
@@ -54,7 +59,9 @@ class _PayQrDialogV2State extends State<PayQrDialogV2> {
|
||||
|
||||
@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, crossAxisAlignment: CrossAxisAlignment.center, children: [
|
||||
// Container(
|
||||
@@ -353,14 +360,66 @@ class _PayQrDialogV2State extends State<PayQrDialogV2> {
|
||||
),
|
||||
),
|
||||
),
|
||||
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,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
]),
|
||||
);
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user