merge:合并代码

This commit is contained in:
“ante” 2024-04-10 17:22:11 +08:00
commit 0b5ebb8e89
5 changed files with 80 additions and 86 deletions

View File

@ -629,21 +629,20 @@
"添加成功": "Add success", "添加成功": "Add success",
"搜索": "Search", "搜索": "Search",
"permission_dialog_camera": "camera", "相机": "camera",
"permission_dialog_photos": "photos", "相册": "photos",
"permission_dialog_storage": "storage", "读写": "storage",
"permission_dialog_location": "location", "定位": "location",
"permission_dialog_camera_text": "Access to the camera is required to take photos and upload files, such as uploading a profile picture", "需要访问相机权限才能拍照上传文件例如头像上传": "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", "需要访问相机权限才能使用相册图片上传文件上传头像": "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", "需要访问读写权限才能使用本地图片上传头像": "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", "需要访问定位权限才能使用添加钥匙功能的位置信息": "Access to location information is required to use the add key function",
"permission_dialog_application": "application", "申请": "application",
"permission_dialog_authority": "permission", "权限": "permission",
"permission_dialog_not_allowed": "Not Allowed", "不允许": "Not Allowed",
"permission_dialog_allowed": "Allowed", "允许": "Allowed",
"permission_dialog_permission_denied": "Permission denied", "权限被拒绝": "Permission denied",
"permission_dialog_open_permissions": "Please manually enable it in the system settings", "请手动在系统设置中开启": "Please manually enable it in the system settings",
"permission_dialog_permission_continue_text": "Permission to continue using the application.", "权限以继续使用应用": "Permission to continue using the application.",
"permission_dialog_go_set_up": "Go set it up" "去设置": "Go set it up"
} }

View File

@ -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": "去设置" "去设置": "去设置"
} }

View File

@ -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": "去设置" "去设置": "去设置"
} }

View File

@ -22,22 +22,24 @@ class BaseProvider extends GetConnect with Api {
} }
@override @override
Future<Response<T>> post<T>(String? url, body, Future<Response<T>> post<T>(
{String? contentType = "application/json", String? url,
Map<String, String>? headers, body, {
Map<String, dynamic>? query, String? contentType = "application/json",
Decoder<T>? decoder, Map<String, String>? headers,
bool? isUnUploadFile = true, Map<String, dynamic>? query,
Progress? uploadProgress, Decoder<T>? decoder,
bool? isUnShowLoading = false,// loading bool? isUnUploadFile = true,
bool? isUserBaseUrl = true,// 使baseUrl Progress? uploadProgress,
}) async { bool? isUnShowLoading = false, // loading
bool? isUserBaseUrl = true, // 使baseUrl
}) async {
// print("post: url:${url} body:${body} contentType:${contentType} headers:${headers} query:${query}"); // print("post: url:${url} body:${body} contentType:${contentType} headers:${headers} query:${query}");
if (isUnShowLoading == false) EasyLoading.show(); if (isUnShowLoading == false) EasyLoading.show();
// print('请求url======>$url'); // print('请求url======>$url');
if (isUserBaseUrl == false){ if (isUserBaseUrl == false) {
httpClient.baseUrl = ''; httpClient.baseUrl = '';
}else{ } else {
httpClient.baseUrl = '${F.apiPrefix}/api'; httpClient.baseUrl = '${F.apiPrefix}/api';
} }
print('请求body体======>$body'); print('请求body体======>$body');
@ -51,6 +53,9 @@ class BaseProvider extends GetConnect with Api {
if (res.body == null) { if (res.body == null) {
if (EasyLoading.isShow) EasyLoading.dismiss(animation: true); if (EasyLoading.isShow) EasyLoading.dismiss(animation: true);
// EasyLoading.showToast("Network Error!", duration: 2000.milliseconds); // EasyLoading.showToast("Network Error!", duration: 2000.milliseconds);
if (res.statusCode == null) {
EasyLoading.showToast("Network Error!", duration: 2000.milliseconds);
}
var rs = { var rs = {
"errorMsg": "Network Error!", "errorMsg": "Network Error!",
"errorCode": -1, "errorCode": -1,

View File

@ -8,21 +8,17 @@ import 'package:star_lock/translations/trans_lib.dart';
class PermissionDialog { class PermissionDialog {
static Map<Permission, String> titles = { static Map<Permission, String> titles = {
Permission.camera: TranslationLoader.lanKeys!.permissionDialogCamera!.tr, Permission.camera: '相机'.tr,
Permission.photos: TranslationLoader.lanKeys!.permissionDialogPhotos!.tr, Permission.photos: '相册'.tr,
Permission.storage: TranslationLoader.lanKeys!.permissionDialogStorage!.tr, Permission.storage: '读写'.tr,
Permission.location: Permission.location: '定位'.tr,
TranslationLoader.lanKeys!.permissionDialogLocation!.tr,
}; };
static Map<Permission, String> contents = { static Map<Permission, String> contents = {
Permission.camera: Permission.camera: '需要访问相机权限才能拍照上传文件例如头像上传'.tr,
TranslationLoader.lanKeys!.permissionDialogCameraText!.tr, Permission.photos: '需要访问相机权限才能使用相册图片上传文件上传头像'.tr,
Permission.photos: TranslationLoader.lanKeys!.permissionDialogPhotos!.tr, Permission.storage: '需要访问读写权限才能使用本地图片上传头像'.tr,
Permission.storage: Permission.location: '需要访问定位权限才能使用添加钥匙功能的位置信息'.tr,
TranslationLoader.lanKeys!.permissionDialogStorageText!.tr,
Permission.location:
TranslationLoader.lanKeys!.permissionDialogLocationText!.tr,
}; };
// //
@ -40,20 +36,17 @@ class PermissionDialog {
return PopScope( return PopScope(
canPop: false, canPop: false,
child: CupertinoAlertDialog( child: CupertinoAlertDialog(
title: Text( title: Text('${'申请'.tr}${titles[permission] ?? ''}${'权限'.tr}'),
'${TranslationLoader.lanKeys!.permissionDialogApplication!.tr}${titles[permission] ?? ''}${TranslationLoader.lanKeys!.permissionDialogAuthority!.tr}'),
content: Text(contents[permission] ?? ''), content: Text(contents[permission] ?? ''),
actions: [ actions: [
CupertinoDialogAction( CupertinoDialogAction(
child: Text(TranslationLoader child: Text('不允许'.tr),
.lanKeys!.permissionDialogNotAllowed!.tr),
onPressed: () { onPressed: () {
Get.back(result: false); Get.back(result: false);
}, },
), ),
CupertinoDialogAction( CupertinoDialogAction(
child: Text( child: Text('允许'.tr),
TranslationLoader.lanKeys!.permissionDialogAllowed!.tr),
onPressed: () { onPressed: () {
Get.back(result: true); Get.back(result: true);
}, },
@ -62,7 +55,7 @@ class PermissionDialog {
)); ));
}, },
); );
if(application){ if (application) {
await Storage.setString(titles[permission], titles[permission]); await Storage.setString(titles[permission], titles[permission]);
} }
} else if (cache is String) { } else if (cache is String) {
@ -89,14 +82,12 @@ class PermissionDialog {
return PopScope( return PopScope(
canPop: false, canPop: false,
child: CupertinoAlertDialog( child: CupertinoAlertDialog(
title: Text( title: Text('${titles[permission] ?? ''}${'权限被拒绝'.tr}'),
'${titles[permission] ?? ''}${TranslationLoader.lanKeys!.permissionDialogPermissionDenied!.tr}'),
content: Text( content: Text(
'${contents[permission] ?? ''}${TranslationLoader.lanKeys!.permissionDialogOpenPermissions!.tr}${titles[permission]}${TranslationLoader.lanKeys!.permissionDialogCameraText!.tr}'), '${contents[permission] ?? ''}${'请手动在系统设置中开启'.tr}${titles[permission]}${'权限以继续使用应用'.tr}'),
actions: [ actions: [
CupertinoDialogAction( CupertinoDialogAction(
child: Text( child: Text('去设置'.tr),
TranslationLoader.lanKeys!.permissionDialogGoSetUp!.tr),
onPressed: () { onPressed: () {
Get.back(); // Get.back(); //
openAppSettings(); // openAppSettings(); //