startWriteStream method

  1. @override
Future<SafWriteStreamInfo> startWriteStream(
  1. String treeUri,
  2. String fileName,
  3. String mime, {
  4. bool? overwrite,
})
override

Implementation

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