|
|
@@ -262,14 +262,51 @@ class ContactBackUpController extends BaseController {
|
|
|
}
|
|
|
|
|
|
Future<void> deleteBtnClick() async {
|
|
|
- // 获取要删除的资产
|
|
|
- final fileToDelete = backupFiles.where((file) => selectedFiles.contains(file.path)).toList();
|
|
|
- //
|
|
|
- for (var file in fileToDelete) {
|
|
|
- await file.delete();
|
|
|
- }
|
|
|
- ToastUtil.show("Successful");
|
|
|
- exitEditMode();
|
|
|
- loadBackupFiles();
|
|
|
+ showCupertinoModalPopup(
|
|
|
+ context: Get.context!,
|
|
|
+ builder: (context) {
|
|
|
+ return CupertinoActionSheet(
|
|
|
+ actions: <Widget>[
|
|
|
+ //操作按钮集合
|
|
|
+ CupertinoActionSheetAction(
|
|
|
+ onPressed: () async {
|
|
|
+ Navigator.pop(context);
|
|
|
+ // 获取要删除的资产
|
|
|
+ final fileToDelete = backupFiles.where((file) => selectedFiles.contains(file.path)).toList();
|
|
|
+ //
|
|
|
+ for (var file in fileToDelete) {
|
|
|
+ await file.delete();
|
|
|
+ }
|
|
|
+ ToastUtil.show("Successful");
|
|
|
+ exitEditMode();
|
|
|
+ loadBackupFiles();
|
|
|
+ },
|
|
|
+ child: Text(
|
|
|
+ 'Delete',
|
|
|
+ style: TextStyle(
|
|
|
+ color: "#FC4C4F".color,
|
|
|
+ fontWeight: FontWeight.w500,
|
|
|
+ fontSize: 16.sp,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ cancelButton: CupertinoActionSheetAction(
|
|
|
+ //取消按钮
|
|
|
+ onPressed: () {
|
|
|
+ Navigator.pop(context);
|
|
|
+ },
|
|
|
+ child: Text(
|
|
|
+ 'Cancel',
|
|
|
+ style: TextStyle(
|
|
|
+ color: "#007AFF".color,
|
|
|
+ fontWeight: FontWeight.w500,
|
|
|
+ fontSize: 16.sp,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ },
|
|
|
+ );
|
|
|
}
|
|
|
}
|