saveFile method
Future<Map<String, dynamic> >
saveFile(
- String file, {
- String? name,
- bool isReturnPathOfIOS = false,
- bool skipIfExists = false,
- String? androidRelativePath,
override
Save file to gallery
file
Path to the file to save
name
Optional custom filename
isReturnPathOfIOS
Whether to return the file path on iOS
skipIfExists
Skip saving if file with same name exists
androidRelativePath
Custom subfolder path for Android
Implementation
@override
Future<Map<String, dynamic>> saveFile(
String file, {
String? name,
bool isReturnPathOfIOS = false,
bool skipIfExists = false,
String? androidRelativePath,
}) async {
final result = await methodChannel.invokeMethod('saveFileToGallery', {
'file': file,
'name': name,
'isReturnPathOfIOS': isReturnPathOfIOS,
'skipIfExists': skipIfExists,
'androidRelativePath': androidRelativePath,
});
return Map<String, dynamic>.from(result ??
{
'isSuccess': false,
'errorMessage': 'Unknown error occurred',
});
}