99 lines
2.7 KiB
Dart
99 lines
2.7 KiB
Dart
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
import 'package:get/get.dart';
|
|
|
|
import '../translations/trans_lib.dart';
|
|
import 'showDeleteAdministratorIsHaveAllDataWidget.dart';
|
|
|
|
typedef BlockIsHaveAllDataCallback = void Function(bool isAllData);
|
|
|
|
class ShowTipView {
|
|
|
|
// 只有一个确定按钮
|
|
void showSureAlertDialog(String contentStr) {
|
|
showCupertinoDialog(
|
|
context: Get.context!,
|
|
builder: (context) {
|
|
return CupertinoAlertDialog(
|
|
content: Text(contentStr),
|
|
actions: [
|
|
CupertinoDialogAction(
|
|
child: Text(TranslationLoader.lanKeys!.sure!.tr),
|
|
onPressed: () {
|
|
Get.back();
|
|
},
|
|
),
|
|
],
|
|
);
|
|
},
|
|
);
|
|
}
|
|
|
|
// 授权管理员调用是否删除数据
|
|
void showDeleteAdministratorIsHaveAllDataDialog(String contentStr, BlockIsHaveAllDataCallback blockIsHaveAllDataCallback) {
|
|
bool selet = false;
|
|
showDialog(
|
|
context: Get.context!,
|
|
builder: (BuildContext context) {
|
|
return CupertinoAlertDialog(
|
|
title: Text("提示".tr),
|
|
content: SizedBox(
|
|
// height: 100.h,
|
|
child: ShowDeleteAdministratorIsHaveAllDataWidget(
|
|
contentStr: contentStr,
|
|
blockIsHaveAllDataCallback: (a){
|
|
selet = a;
|
|
},
|
|
),
|
|
),
|
|
actions: [
|
|
CupertinoDialogAction(
|
|
child: Text(TranslationLoader.lanKeys!.cancel!.tr),
|
|
onPressed: () {
|
|
Get.back();
|
|
},
|
|
),
|
|
CupertinoDialogAction(
|
|
child: Text(TranslationLoader.lanKeys!.sure!.tr),
|
|
onPressed: () {
|
|
Get.back();
|
|
blockIsHaveAllDataCallback(selet);
|
|
},
|
|
),
|
|
],
|
|
);
|
|
},
|
|
);
|
|
}
|
|
|
|
// 有取消和确定按钮
|
|
void showIosTipWithContentDialog(String contentStr, Function sureClick) {
|
|
showCupertinoDialog(
|
|
context: Get.context!,
|
|
builder: (context) {
|
|
return CupertinoAlertDialog(
|
|
content: Text(contentStr),
|
|
actions: [
|
|
CupertinoDialogAction(
|
|
child: Text(TranslationLoader.lanKeys!.cancel!.tr),
|
|
onPressed: () {
|
|
Get.back();
|
|
},
|
|
),
|
|
CupertinoDialogAction(
|
|
child: Text(TranslationLoader.lanKeys!.sure!.tr),
|
|
onPressed: () {
|
|
Get.back();
|
|
sureClick();
|
|
},
|
|
),
|
|
],
|
|
);
|
|
},
|
|
);
|
|
}
|
|
|
|
} |