mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-20 03:06:59 +08:00
@@ -3,10 +3,12 @@ import 'dart:typed_data';
|
||||
|
||||
import 'package:PiliPlus/common/constants.dart';
|
||||
import 'package:PiliPlus/http/init.dart';
|
||||
import 'package:PiliPlus/utils/extension.dart';
|
||||
import 'package:PiliPlus/utils/extension/file_ext.dart';
|
||||
import 'package:PiliPlus/utils/extension/string_ext.dart';
|
||||
import 'package:PiliPlus/utils/global_data.dart';
|
||||
import 'package:PiliPlus/utils/path_utils.dart';
|
||||
import 'package:PiliPlus/utils/permission_handler.dart';
|
||||
import 'package:PiliPlus/utils/platform_utils.dart';
|
||||
import 'package:PiliPlus/utils/storage_pref.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
@@ -109,7 +111,8 @@ abstract class ImageUtils {
|
||||
required int height,
|
||||
}) async {
|
||||
try {
|
||||
if (Utils.isMobile && !await checkPermissionDependOnSdkInt(context)) {
|
||||
if (PlatformUtils.isMobile &&
|
||||
!await checkPermissionDependOnSdkInt(context)) {
|
||||
return false;
|
||||
}
|
||||
if (!silentDownImg) SmartDialog.showLoading(msg: '正在下载');
|
||||
@@ -168,7 +171,8 @@ abstract class ImageUtils {
|
||||
List<String> imgList, [
|
||||
CacheManager? manager,
|
||||
]) async {
|
||||
if (Utils.isMobile && !await checkPermissionDependOnSdkInt(context)) {
|
||||
if (PlatformUtils.isMobile &&
|
||||
!await checkPermissionDependOnSdkInt(context)) {
|
||||
return false;
|
||||
}
|
||||
CancelToken? cancelToken;
|
||||
@@ -211,7 +215,7 @@ abstract class ImageUtils {
|
||||
}
|
||||
});
|
||||
final result = await Future.wait(futures, eagerError: true);
|
||||
if (Utils.isMobile) {
|
||||
if (PlatformUtils.isMobile) {
|
||||
final delList = <String>[];
|
||||
final saveList = <SaveFileData>[];
|
||||
for (var i in result) {
|
||||
@@ -292,7 +296,7 @@ abstract class ImageUtils {
|
||||
}) async {
|
||||
SaveResult? result;
|
||||
fileName += '.$ext';
|
||||
if (Utils.isMobile) {
|
||||
if (PlatformUtils.isMobile) {
|
||||
SmartDialog.showLoading(msg: '正在保存');
|
||||
result = await SaverGallery.saveImage(
|
||||
bytes,
|
||||
@@ -336,7 +340,7 @@ abstract class ImageUtils {
|
||||
return;
|
||||
}
|
||||
SaveResult? result;
|
||||
if (Utils.isMobile) {
|
||||
if (PlatformUtils.isMobile) {
|
||||
result = await SaverGallery.saveFile(
|
||||
filePath: filePath,
|
||||
fileName: fileName,
|
||||
|
||||
Reference in New Issue
Block a user