Impl saveFile on Windows platform

This commit is contained in:
2023-09-09 09:56:45 +08:00
parent 99550bdbda
commit 25447e9667
6 changed files with 90 additions and 5 deletions

View File

@@ -7,7 +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");
static const _safChannel = MethodChannel("lifegpc.eh_downloader_flutter/saf");
String? _currentExe;
bool _currentExeLoaded = false;
@@ -28,7 +28,10 @@ class Path {
}
/// 保存文件
static Future<void> saveFile(String filenameWithoutExtension,String mimeType,Uint8List bytes,{String dir=""}) async{
return _safChannel.invokeMethod("saveFile",[filenameWithoutExtension,dir,mimeType,bytes]);
Future<void> saveFile(
String filenameWithoutExtension, String mimeType, Uint8List bytes,
{String dir = ""}) async {
return _safChannel.invokeMethod(
"saveFile", [filenameWithoutExtension, dir, mimeType, bytes]);
}
}