opt: func

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-05-07 14:41:25 +08:00
parent 286193f08f
commit dd6ff101d1
63 changed files with 181 additions and 180 deletions

View File

@@ -91,15 +91,15 @@ class DownloadUtils {
final androidInfo = await DeviceInfoPlugin().androidInfo;
if (androidInfo.version.sdkInt <= 32) {
if (!context.mounted) return false;
return await requestStoragePer(context);
return requestStoragePer(context);
} else {
return await requestPhotoPer();
return requestPhotoPer();
}
}
return await requestStoragePer(context);
return requestStoragePer(context);
}
static Future downloadLivePhoto({
static Future<bool> downloadLivePhoto({
required BuildContext context,
required String url,
required String liveUrl,
@@ -108,7 +108,7 @@ class DownloadUtils {
}) async {
try {
if (!await checkPermissionDependOnSdkInt(context)) {
return;
return false;
}
SmartDialog.showLoading(msg: '正在下载');
@@ -168,12 +168,12 @@ class DownloadUtils {
}
}
static Future downloadImg(
static Future<bool> downloadImg(
BuildContext context,
List<String> imgList, {
String imgType = 'cover',
}) async {
if (!await checkPermissionDependOnSdkInt(context)) return;
if (!await checkPermissionDependOnSdkInt(context)) return false;
final cancelToken = CancelToken();
SmartDialog.showLoading(
msg: '正在下载原图',