writeFileBytes method

  1. @override
Future<SafNewFile> writeFileBytes(
  1. String treeUri,
  2. String fileName,
  3. String mime,
  4. Uint8List data, {
  5. bool? overwrite,
})
override

Implementation

@override
Future<SafNewFile> writeFileBytes(
    String treeUri, String fileName, String mime, Uint8List data,
    {bool? overwrite}) async {
  var map =
      await methodChannel.invokeMapMethod<String, dynamic>('writeFileBytes', {
    'treeUri': treeUri.toString(),
    'fileName': fileName,
    'mime': mime,
    'data': data,
    'overwrite': overwrite ?? false,
  });
  if (map == null) {
    throw Exception('Unexpected empty response from `writeFileBytes`');
  }
  return SafNewFile.fromMap(map);
}