merge:合并代码
This commit is contained in:
commit
0b5ebb8e89
@ -629,21 +629,20 @@
|
||||
"添加成功": "Add success",
|
||||
"搜索": "Search",
|
||||
|
||||
"permission_dialog_camera": "camera",
|
||||
"permission_dialog_photos": "photos",
|
||||
"permission_dialog_storage": "storage",
|
||||
"permission_dialog_location": "location",
|
||||
"permission_dialog_camera_text": "Access to the camera is required to take photos and upload files, such as uploading a profile picture",
|
||||
"permission_dialog_photos_text": "Access to camera is required to upload files and avatars using album images",
|
||||
"permission_dialog_storage_text": "Access to read and write permissions is required to upload avatars using local images",
|
||||
"permission_dialog_location_text": "Access to location information is required to use the add key function",
|
||||
"permission_dialog_application": "application",
|
||||
"permission_dialog_authority": "permission",
|
||||
"permission_dialog_not_allowed": "Not Allowed",
|
||||
"permission_dialog_allowed": "Allowed",
|
||||
"permission_dialog_permission_denied": "Permission denied",
|
||||
"permission_dialog_open_permissions": "Please manually enable it in the system settings",
|
||||
"permission_dialog_permission_continue_text": "Permission to continue using the application.",
|
||||
"permission_dialog_go_set_up": "Go set it up"
|
||||
|
||||
"相机": "camera",
|
||||
"相册": "photos",
|
||||
"读写": "storage",
|
||||
"定位": "location",
|
||||
"需要访问相机权限才能拍照上传文件例如头像上传": "Access to the camera is required to take photos and upload files, such as uploading a profile picture",
|
||||
"需要访问相机权限才能使用相册图片上传文件上传头像": "Access to camera is required to upload files and avatars using album images",
|
||||
"需要访问读写权限才能使用本地图片上传头像": "Access to read and write permissions is required to upload avatars using local images",
|
||||
"需要访问定位权限才能使用添加钥匙功能的位置信息": "Access to location information is required to use the add key function",
|
||||
"申请": "application",
|
||||
"权限": "permission",
|
||||
"不允许": "Not Allowed",
|
||||
"允许": "Allowed",
|
||||
"权限被拒绝": "Permission denied",
|
||||
"请手动在系统设置中开启": "Please manually enable it in the system settings",
|
||||
"权限以继续使用应用": "Permission to continue using the application.",
|
||||
"去设置": "Go set it up"
|
||||
}
|
||||
|
||||
@ -629,20 +629,20 @@
|
||||
"添加成功": "添加成功",
|
||||
"搜索": "搜索",
|
||||
|
||||
"permission_dialog_camera": "相机",
|
||||
"permission_dialog_photos": "相册",
|
||||
"permission_dialog_storage": "读写",
|
||||
"permission_dialog_location": "定位",
|
||||
"permission_dialog_camera_text": "需要访问相机权限才能拍照上传文件例如头像上传",
|
||||
"permission_dialog_photos_text": "需要访问相机权限才能使用相册图片上传文件上传头像",
|
||||
"permission_dialog_storage_text": "需要访问读写权限才能使用本地图片上传头像",
|
||||
"permission_dialog_location_text": "需要访问定位权限才能使用添加钥匙功能的位置信息",
|
||||
"permission_dialog_application": "申请",
|
||||
"permission_dialog_authority": "权限",
|
||||
"permission_dialog_not_allowed": "不允许",
|
||||
"permission_dialog_allowed": "允许",
|
||||
"permission_dialog_permission_denied": "权限被拒绝",
|
||||
"permission_dialog_open_permissions": "请手动在系统设置中开启",
|
||||
"permission_dialog_permission_continue_text": "权限以继续使用应用。",
|
||||
"permission_dialog_go_set_up": "去设置"
|
||||
"相机": "相机",
|
||||
"相册": "相册",
|
||||
"读写": "读写",
|
||||
"定位": "定位",
|
||||
"需要访问相机权限才能拍照上传文件例如头像上传": "需要访问相机权限才能拍照上传文件例如头像上传",
|
||||
"需要访问相机权限才能使用相册图片上传文件上传头像": "需要访问相机权限才能使用相册图片上传文件上传头像",
|
||||
"需要访问读写权限才能使用本地图片上传头像": "需要访问读写权限才能使用本地图片上传头像",
|
||||
"需要访问定位权限才能使用添加钥匙功能的位置信息": "需要访问定位权限才能使用添加钥匙功能的位置信息",
|
||||
"申请": "申请",
|
||||
"权限": "权限",
|
||||
"不允许": "不允许",
|
||||
"允许": "允许",
|
||||
"权限被拒绝": "权限被拒绝",
|
||||
"请手动在系统设置中开启": "请手动在系统设置中开启",
|
||||
"权限以继续使用应用": "权限以继续使用应用。",
|
||||
"去设置": "去设置"
|
||||
}
|
||||
|
||||
@ -630,21 +630,20 @@
|
||||
"添加成功": "添加成功",
|
||||
"搜索": "搜索",
|
||||
|
||||
"permission_dialog_camera": "相机",
|
||||
"permission_dialog_photos": "相册",
|
||||
"permission_dialog_storage": "读写",
|
||||
"permission_dialog_location": "定位",
|
||||
"permission_dialog_camera_text": "需要访问相机权限才能拍照上传文件例如头像上传",
|
||||
"permission_dialog_photos_text": "需要访问相机权限才能使用相册图片上传文件上传头像",
|
||||
"permission_dialog_storage_text": "需要访问读写权限才能使用本地图片上传头像",
|
||||
"permission_dialog_location_text": "需要访问定位权限才能使用添加钥匙功能的位置信息",
|
||||
"permission_dialog_application": "申请",
|
||||
"permission_dialog_authority": "权限",
|
||||
"permission_dialog_not_allowed": "不允许",
|
||||
"permission_dialog_allowed": "允许",
|
||||
"permission_dialog_permission_denied": "权限被拒绝",
|
||||
"permission_dialog_open_permissions": "请手动在系统设置中开启",
|
||||
"permission_dialog_permission_continue_text": "权限以继续使用应用。",
|
||||
"permission_dialog_go_set_up": "去设置"
|
||||
|
||||
"相机": "相机",
|
||||
"相册": "相册",
|
||||
"读写": "读写",
|
||||
"定位": "定位",
|
||||
"需要访问相机权限才能拍照上传文件例如头像上传": "需要访问相机权限才能拍照上传文件例如头像上传",
|
||||
"需要访问相机权限才能使用相册图片上传文件上传头像": "需要访问相机权限才能使用相册图片上传文件上传头像",
|
||||
"需要访问读写权限才能使用本地图片上传头像": "需要访问读写权限才能使用本地图片上传头像",
|
||||
"需要访问定位权限才能使用添加钥匙功能的位置信息": "需要访问定位权限才能使用添加钥匙功能的位置信息",
|
||||
"申请": "申请",
|
||||
"权限": "权限",
|
||||
"不允许": "不允许",
|
||||
"允许": "允许",
|
||||
"权限被拒绝": "权限被拒绝",
|
||||
"请手动在系统设置中开启": "请手动在系统设置中开启",
|
||||
"权限以继续使用应用": "权限以继续使用应用。",
|
||||
"去设置": "去设置"
|
||||
}
|
||||
|
||||
@ -22,22 +22,24 @@ class BaseProvider extends GetConnect with Api {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Response<T>> post<T>(String? url, body,
|
||||
{String? contentType = "application/json",
|
||||
Map<String, String>? headers,
|
||||
Map<String, dynamic>? query,
|
||||
Decoder<T>? decoder,
|
||||
bool? isUnUploadFile = true,
|
||||
Progress? uploadProgress,
|
||||
bool? isUnShowLoading = false,// 是否显示loading
|
||||
bool? isUserBaseUrl = true,// 文件上传不使用baseUrl
|
||||
}) async {
|
||||
Future<Response<T>> post<T>(
|
||||
String? url,
|
||||
body, {
|
||||
String? contentType = "application/json",
|
||||
Map<String, String>? headers,
|
||||
Map<String, dynamic>? query,
|
||||
Decoder<T>? decoder,
|
||||
bool? isUnUploadFile = true,
|
||||
Progress? uploadProgress,
|
||||
bool? isUnShowLoading = false, // 是否显示loading
|
||||
bool? isUserBaseUrl = true, // 文件上传不使用baseUrl
|
||||
}) async {
|
||||
// print("post: url:${url} body:${body} contentType:${contentType} headers:${headers} query:${query}");
|
||||
if (isUnShowLoading == false) EasyLoading.show();
|
||||
// print('请求url======>$url');
|
||||
if (isUserBaseUrl == false){
|
||||
if (isUserBaseUrl == false) {
|
||||
httpClient.baseUrl = '';
|
||||
}else{
|
||||
} else {
|
||||
httpClient.baseUrl = '${F.apiPrefix}/api';
|
||||
}
|
||||
print('请求body体======>$body');
|
||||
@ -51,6 +53,9 @@ class BaseProvider extends GetConnect with Api {
|
||||
if (res.body == null) {
|
||||
if (EasyLoading.isShow) EasyLoading.dismiss(animation: true);
|
||||
// EasyLoading.showToast("Network Error!", duration: 2000.milliseconds);
|
||||
if (res.statusCode == null) {
|
||||
EasyLoading.showToast("Network Error!", duration: 2000.milliseconds);
|
||||
}
|
||||
var rs = {
|
||||
"errorMsg": "Network Error!",
|
||||
"errorCode": -1,
|
||||
|
||||
@ -8,21 +8,17 @@ import 'package:star_lock/translations/trans_lib.dart';
|
||||
|
||||
class PermissionDialog {
|
||||
static Map<Permission, String> titles = {
|
||||
Permission.camera: TranslationLoader.lanKeys!.permissionDialogCamera!.tr,
|
||||
Permission.photos: TranslationLoader.lanKeys!.permissionDialogPhotos!.tr,
|
||||
Permission.storage: TranslationLoader.lanKeys!.permissionDialogStorage!.tr,
|
||||
Permission.location:
|
||||
TranslationLoader.lanKeys!.permissionDialogLocation!.tr,
|
||||
Permission.camera: '相机'.tr,
|
||||
Permission.photos: '相册'.tr,
|
||||
Permission.storage: '读写'.tr,
|
||||
Permission.location: '定位'.tr,
|
||||
};
|
||||
|
||||
static Map<Permission, String> contents = {
|
||||
Permission.camera:
|
||||
TranslationLoader.lanKeys!.permissionDialogCameraText!.tr,
|
||||
Permission.photos: TranslationLoader.lanKeys!.permissionDialogPhotos!.tr,
|
||||
Permission.storage:
|
||||
TranslationLoader.lanKeys!.permissionDialogStorageText!.tr,
|
||||
Permission.location:
|
||||
TranslationLoader.lanKeys!.permissionDialogLocationText!.tr,
|
||||
Permission.camera: '需要访问相机权限才能拍照上传文件例如头像上传'.tr,
|
||||
Permission.photos: '需要访问相机权限才能使用相册图片上传文件上传头像'.tr,
|
||||
Permission.storage: '需要访问读写权限才能使用本地图片上传头像'.tr,
|
||||
Permission.location: '需要访问定位权限才能使用添加钥匙功能的位置信息'.tr,
|
||||
};
|
||||
|
||||
//显示权限判断申请框
|
||||
@ -40,20 +36,17 @@ class PermissionDialog {
|
||||
return PopScope(
|
||||
canPop: false,
|
||||
child: CupertinoAlertDialog(
|
||||
title: Text(
|
||||
'${TranslationLoader.lanKeys!.permissionDialogApplication!.tr}${titles[permission] ?? ''}${TranslationLoader.lanKeys!.permissionDialogAuthority!.tr}'),
|
||||
title: Text('${'申请'.tr}${titles[permission] ?? ''}${'权限'.tr}'),
|
||||
content: Text(contents[permission] ?? ''),
|
||||
actions: [
|
||||
CupertinoDialogAction(
|
||||
child: Text(TranslationLoader
|
||||
.lanKeys!.permissionDialogNotAllowed!.tr),
|
||||
child: Text('不允许'.tr),
|
||||
onPressed: () {
|
||||
Get.back(result: false);
|
||||
},
|
||||
),
|
||||
CupertinoDialogAction(
|
||||
child: Text(
|
||||
TranslationLoader.lanKeys!.permissionDialogAllowed!.tr),
|
||||
child: Text('允许'.tr),
|
||||
onPressed: () {
|
||||
Get.back(result: true);
|
||||
},
|
||||
@ -62,7 +55,7 @@ class PermissionDialog {
|
||||
));
|
||||
},
|
||||
);
|
||||
if(application){
|
||||
if (application) {
|
||||
await Storage.setString(titles[permission], titles[permission]);
|
||||
}
|
||||
} else if (cache is String) {
|
||||
@ -89,14 +82,12 @@ class PermissionDialog {
|
||||
return PopScope(
|
||||
canPop: false,
|
||||
child: CupertinoAlertDialog(
|
||||
title: Text(
|
||||
'${titles[permission] ?? ''}${TranslationLoader.lanKeys!.permissionDialogPermissionDenied!.tr}'),
|
||||
title: Text('${titles[permission] ?? ''}${'权限被拒绝'.tr}'),
|
||||
content: Text(
|
||||
'${contents[permission] ?? ''},${TranslationLoader.lanKeys!.permissionDialogOpenPermissions!.tr}${titles[permission]}${TranslationLoader.lanKeys!.permissionDialogCameraText!.tr}'),
|
||||
'${contents[permission] ?? ''},${'请手动在系统设置中开启'.tr}${titles[permission]}${'权限以继续使用应用'.tr}'),
|
||||
actions: [
|
||||
CupertinoDialogAction(
|
||||
child: Text(
|
||||
TranslationLoader.lanKeys!.permissionDialogGoSetUp!.tr),
|
||||
child: Text('去设置'.tr),
|
||||
onPressed: () {
|
||||
Get.back(); // 关闭对话框
|
||||
openAppSettings(); // 打开系统设置页面
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user