From 460ca1e2e2c0be8f60b7ec182b1b8a83bd447f59 Mon Sep 17 00:00:00 2001 From: Liuyf Date: Wed, 19 Feb 2025 11:52:38 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E5=A4=8D=E9=97=A8?= =?UTF-8?q?=E9=93=83=E7=A0=81=E4=BF=9D=E5=AD=98=E5=90=8E=E6=98=AF=E9=BB=91?= =?UTF-8?q?=E8=89=B2=E5=9B=BE=E7=89=87=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tools/showCupertinoAlertView.dart | 242 +++++++++++++------------- 1 file changed, 125 insertions(+), 117 deletions(-) diff --git a/lib/tools/showCupertinoAlertView.dart b/lib/tools/showCupertinoAlertView.dart index 607dc414..9b303167 100755 --- a/lib/tools/showCupertinoAlertView.dart +++ b/lib/tools/showCupertinoAlertView.dart @@ -456,16 +456,24 @@ class ShowCupertinoAlertView { onClick: () async { // 截图并保存到相册 try { - final RenderRepaintBoundary boundary = - _repaintBoundaryKey.currentContext! - .findRenderObject()! - as RenderRepaintBoundary; - final image = await boundary.toImage(); - final ByteData? byteData = await image - .toByteData(format: ImageByteFormat.png); + final QrPainter painter = QrPainter( + data: qrCodeUrl, + version: QrVersions.auto, + gapless: false, + errorCorrectionLevel: QrErrorCorrectLevel.L, + eyeStyle: const QrEyeStyle( + eyeShape: QrEyeShape.square, + color: Colors.white, + ), + dataModuleStyle: const QrDataModuleStyle( + dataModuleShape: QrDataModuleShape.square, + color: Colors.white, + )); + final ByteData? byteData = + await painter.toImageData(600.0, + format: ImageByteFormat.png); final Uint8List pngBytes = byteData!.buffer.asUint8List(); - final result = await ImageGallerySaver.saveImage( Uint8List.fromList(pngBytes), @@ -498,113 +506,113 @@ class ShowCupertinoAlertView { ); } - // //邮件通知类型选择弹窗 - // void emailNotifyTypeSlectAlert() { - // showCupertinoDialog( - // context: Get.context!, - // builder: (BuildContext context) { - // return CupertinoAlertDialog( - // title: const Text('类型选择'), - // content: Column( - // children: [ - // Padding( - // padding: EdgeInsets.only( - // left: 10.w, top: 8.h, bottom: 16.h, right: 10.w), - // child: Align( - // alignment: Alignment.centerLeft, - // child: Text('请选择要使用哪种类型', style: TextStyle(fontSize: 20.sp)), - // ), - // ), - // GestureDetector( - // onTap: () { - // setState(() { - // isSystemEmailSelected = true; - // }); - // }, - // child: Row( - // mainAxisAlignment: MainAxisAlignment.start, - // crossAxisAlignment: CrossAxisAlignment.center, - // children: [ - // Image.asset( - // isSystemEmailSelected - // ? 'images/icon_round_select.png' - // : 'images/icon_round_unSelect.png', - // width: 30.w, - // height: 30.w, - // ), - // Padding( - // padding: EdgeInsets.only(left: 10.w), - // child: Text( - // '系统邮件(推荐)', - // style: TextStyle( - // fontSize: 22.sp, fontWeight: FontWeight.bold), - // ), - // ), - // ], - // ), - // ), - // Padding( - // padding: EdgeInsets.only(top: 6.h, left: 10.w, bottom: 10.h), - // child: Align( - // alignment: Alignment.centerLeft, - // child: Text( - // '邮件将从软件平台直接发给用户,请根据需要在软件那里购买邮件数量', - // style: TextStyle(fontSize: 18.sp), - // textAlign: TextAlign.left, - // ), - // ), - // ), - // GestureDetector( - // onTap: () { - // setState(() { - // isSystemEmailSelected = false; - // }); - // }, - // child: Row( - // mainAxisAlignment: MainAxisAlignment.start, - // crossAxisAlignment: CrossAxisAlignment.center, - // children: [ - // Image.asset( - // !isSystemEmailSelected - // ? 'images/icon_round_select.png' - // : 'images/icon_round_unSelect.png', - // width: 30.w, - // height: 30.w, - // ), - // Padding( - // padding: EdgeInsets.only(left: 10.w), - // child: Text( - // '个人邮件', - // style: TextStyle( - // fontSize: 22.sp, fontWeight: FontWeight.bold), - // ), - // ), - // ], - // ), - // ), - // Padding( - // padding: EdgeInsets.only(top: 6.h, left: 10.w), - // child: Align( - // alignment: Alignment.centerLeft, - // child: Text( - // '邮件将从你的个人邮箱发给用户', - // style: TextStyle(fontSize: 18.sp), - // ), - // ), - // ), - // ], - // ), - // actions: [ - // CupertinoDialogAction( - // onPressed: Get.back, - // child: Text( - // '确定'.tr, - // style: TextStyle(color: AppColors.mainColor), - // ), - // ), - // ], - // ); - // }, - // ); - // } +// //邮件通知类型选择弹窗 +// void emailNotifyTypeSlectAlert() { +// showCupertinoDialog( +// context: Get.context!, +// builder: (BuildContext context) { +// return CupertinoAlertDialog( +// title: const Text('类型选择'), +// content: Column( +// children: [ +// Padding( +// padding: EdgeInsets.only( +// left: 10.w, top: 8.h, bottom: 16.h, right: 10.w), +// child: Align( +// alignment: Alignment.centerLeft, +// child: Text('请选择要使用哪种类型', style: TextStyle(fontSize: 20.sp)), +// ), +// ), +// GestureDetector( +// onTap: () { +// setState(() { +// isSystemEmailSelected = true; +// }); +// }, +// child: Row( +// mainAxisAlignment: MainAxisAlignment.start, +// crossAxisAlignment: CrossAxisAlignment.center, +// children: [ +// Image.asset( +// isSystemEmailSelected +// ? 'images/icon_round_select.png' +// : 'images/icon_round_unSelect.png', +// width: 30.w, +// height: 30.w, +// ), +// Padding( +// padding: EdgeInsets.only(left: 10.w), +// child: Text( +// '系统邮件(推荐)', +// style: TextStyle( +// fontSize: 22.sp, fontWeight: FontWeight.bold), +// ), +// ), +// ], +// ), +// ), +// Padding( +// padding: EdgeInsets.only(top: 6.h, left: 10.w, bottom: 10.h), +// child: Align( +// alignment: Alignment.centerLeft, +// child: Text( +// '邮件将从软件平台直接发给用户,请根据需要在软件那里购买邮件数量', +// style: TextStyle(fontSize: 18.sp), +// textAlign: TextAlign.left, +// ), +// ), +// ), +// GestureDetector( +// onTap: () { +// setState(() { +// isSystemEmailSelected = false; +// }); +// }, +// child: Row( +// mainAxisAlignment: MainAxisAlignment.start, +// crossAxisAlignment: CrossAxisAlignment.center, +// children: [ +// Image.asset( +// !isSystemEmailSelected +// ? 'images/icon_round_select.png' +// : 'images/icon_round_unSelect.png', +// width: 30.w, +// height: 30.w, +// ), +// Padding( +// padding: EdgeInsets.only(left: 10.w), +// child: Text( +// '个人邮件', +// style: TextStyle( +// fontSize: 22.sp, fontWeight: FontWeight.bold), +// ), +// ), +// ], +// ), +// ), +// Padding( +// padding: EdgeInsets.only(top: 6.h, left: 10.w), +// child: Align( +// alignment: Alignment.centerLeft, +// child: Text( +// '邮件将从你的个人邮箱发给用户', +// style: TextStyle(fontSize: 18.sp), +// ), +// ), +// ), +// ], +// ), +// actions: [ +// CupertinoDialogAction( +// onPressed: Get.back, +// child: Text( +// '确定'.tr, +// style: TextStyle(color: AppColors.mainColor), +// ), +// ), +// ], +// ); +// }, +// ); +// } }