|
|
@ -95,7 +95,7 @@ class MeetingHomeController extends GetxController { |
|
|
final deviceInfo = DeviceInfoPlugin(); |
|
|
final deviceInfo = DeviceInfoPlugin(); |
|
|
final androidInfo = await deviceInfo.androidInfo; |
|
|
final androidInfo = await deviceInfo.androidInfo; |
|
|
final sdkVersion = androidInfo.version.sdkInt; |
|
|
final sdkVersion = androidInfo.version.sdkInt; |
|
|
|
|
|
|
|
|
// Android 11+ (API 30+) 不需要存储权限 |
|
|
// Android 11+ (API 30+) 不需要存储权限 |
|
|
if (sdkVersion >= 30) { |
|
|
if (sdkVersion >= 30) { |
|
|
Logger.d("Permission", "Android 11+版本,无需请求存储权限"); |
|
|
Logger.d("Permission", "Android 11+版本,无需请求存储权限"); |
|
|
@ -106,13 +106,15 @@ class MeetingHomeController extends GetxController { |
|
|
// 如果获取版本失败,为了兼容性还是请求权限 |
|
|
// 如果获取版本失败,为了兼容性还是请求权限 |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
PermissionUtil.instance |
|
|
PermissionUtil.instance |
|
|
.requestPermission( |
|
|
.requestPermission( |
|
|
permissionType: Permission.storage, |
|
|
permissionType: Permission.storage, |
|
|
permissionName: "meetingStoragePermission".tr, // 对应中文:存储 |
|
|
permissionName: "meetingStoragePermission".tr, // 对应中文:存储 |
|
|
explanationText: "meetingStoragePermissionExplanation".tr, // 对应中文:我们需要访问存储权限,以便您可以选择并上传音频文件。 |
|
|
explanationText: "meetingStoragePermissionExplanation" |
|
|
permanentDenialText: "meetingStoragePermissionPermanentDenial".tr, // 对应中文:检测到您已永久拒绝存储权限。如需继续使用此功能,请前往应用设置中手动开启存储权限。 |
|
|
.tr, // 对应中文:我们需要访问存储权限,以便您可以选择并上传音频文件。 |
|
|
|
|
|
permanentDenialText: "meetingStoragePermissionPermanentDenial" |
|
|
|
|
|
.tr, // 对应中文:检测到您已永久拒绝存储权限。如需继续使用此功能,请前往应用设置中手动开启存储权限。 |
|
|
) |
|
|
) |
|
|
.then((granted) { |
|
|
.then((granted) { |
|
|
if (granted) { |
|
|
if (granted) { |
|
|
@ -169,7 +171,9 @@ class MeetingHomeController extends GetxController { |
|
|
|
|
|
|
|
|
EasyLoading.showToast('shareComplete'.tr); // 对应中文:分享完成! |
|
|
EasyLoading.showToast('shareComplete'.tr); // 对应中文:分享完成! |
|
|
} catch (e) { |
|
|
} catch (e) { |
|
|
EasyLoading.showToast('shareFailed'.trParams({'error': e.toString()})); // 对应中文:分享失败: {error} |
|
|
EasyLoading.showToast('shareFailed' |
|
|
|
|
|
.tr |
|
|
|
|
|
.replaceAll('{error}', e.toString())); // 对应中文:分享失败: {error} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -258,12 +262,21 @@ class MeetingHomeController extends GetxController { |
|
|
addUp++; |
|
|
addUp++; |
|
|
} |
|
|
} |
|
|
} catch (e) { |
|
|
} catch (e) { |
|
|
print('fileProcessingFailed'.trParams({'filePath': fileEntity.path, 'error': e.toString()})); // 对应中文:文件处理失败: {filePath}, 错误: {error} |
|
|
print('fileProcessingFailed' |
|
|
|
|
|
.tr |
|
|
|
|
|
.replaceAll('{filePath}', fileEntity.path) |
|
|
|
|
|
.replaceAll('{error}', |
|
|
|
|
|
e.toString())); // 对应中文:文件处理失败: {filePath}, 错误: {error} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
if (addUp > 0) EasyLoading.showSuccess('importSuccess'.trParams({'count': '$addUp'})); // 对应中文:成功导入本地 {count} 条录音 |
|
|
if (addUp > 0) |
|
|
|
|
|
EasyLoading.showSuccess('importSuccess' |
|
|
|
|
|
.tr |
|
|
|
|
|
.replaceAll('{count}', '$addUp')); // 对应中文:成功导入本地 {count} 条录音 |
|
|
} catch (e) { |
|
|
} catch (e) { |
|
|
EasyLoading.showError('importError'.trParams({'error': e.toString()})); // 对应中文:导入失败: {error} |
|
|
EasyLoading.showError('importError' |
|
|
|
|
|
.tr |
|
|
|
|
|
.replaceAll('{error}', e.toString())); // 对应中文:导入失败: {error} |
|
|
} finally { |
|
|
} finally { |
|
|
EasyLoading.dismiss(); |
|
|
EasyLoading.dismiss(); |
|
|
} |
|
|
} |
|
|
@ -308,7 +321,11 @@ class MeetingHomeController extends GetxController { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} catch (e) { |
|
|
} catch (e) { |
|
|
Logger.error('importFailed'.trParams({'filePath': filePath, 'error': e.toString()})); // 对应中文:导入文件失败: {filePath}, error: {error} |
|
|
Logger.error('importFailed' |
|
|
|
|
|
.tr |
|
|
|
|
|
.replaceAll('{filePath}', filePath) |
|
|
|
|
|
.replaceAll('{error}', |
|
|
|
|
|
e.toString())); // 对应中文:导入文件失败: {filePath}, error: {error} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
EasyLoading.dismiss(); |
|
|
EasyLoading.dismiss(); |
|
|
|