mirror of
https://github.com/lifegpc/eh_downloader_flutter.git
synced 2026-07-08 01:30:28 +08:00
feat: Android get storage permission via SAF
This commit is contained in:
@@ -7,6 +7,7 @@ final Logger _log = Logger("platformPath");
|
||||
|
||||
class Path {
|
||||
static const platform = MethodChannel("lifegpc.eh_downloader_flutter/path");
|
||||
static const _safChannel=MethodChannel("lifegpc.eh_downloader_flutter/saf");
|
||||
String? _currentExe;
|
||||
bool _currentExeLoaded = false;
|
||||
|
||||
@@ -25,4 +26,9 @@ class Path {
|
||||
_currentExeLoaded = true;
|
||||
return _currentExe;
|
||||
}
|
||||
|
||||
/// 保存文件
|
||||
static Future<void> saveFile(String filenameWithoutExtension,String mimeType,Uint8List bytes,{String dir=""}) async{
|
||||
return _safChannel.invokeMethod("saveFile",[filenameWithoutExtension,dir,mimeType,bytes]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user