saveFile method
Future<SaveInfo?>
saveFile({
- required String tempFilePath,
- required String fileName,
- required DirType dirType,
- required DirName dirName,
- required String relativePath,
override
Implementation
@override
Future<SaveInfo?> saveFile({
required String tempFilePath,
required String fileName,
required DirType dirType,
required DirName dirName,
required String relativePath,
}) async {
final string = await methodChannel.invokeMethod<String?>('saveFile', {
"tempFilePath": tempFilePath,
"fileName": fileName,
"dirType": dirType.index,
"dirName": dirName.folder,
"appFolder": relativePath,
});
final jsonString = (string ?? '');
final json = jsonDecode(jsonString);
try {
return SaveInfo.fromJson(json);
} catch (e) {
return null;
}
}