writeFileUriBytes method

  1. @override
Future<SafNewFile> writeFileUriBytes(
  1. String fileUri,
  2. Uint8List data, {
  3. bool? append,
})
override

Implementation

@override
Future<SafNewFile> writeFileUriBytes(
  String fileUri,
  Uint8List data, {
  bool? append,
}) async {
  // This calls the same native method as `writeFileBytes`, but with a different set of parameters.
  final map = await methodChannel.invokeMapMethod<String, dynamic>(
    'writeFileBytes',
    {'fileUri': fileUri.toString(), 'data': data, 'append': append ?? false},
  );
  if (map == null) {
    throw Exception('Unexpected empty response from `writeFileUriBytes`');
  }
  return SafNewFile.fromMap(map);
}