writeFileSync method

  1. @Deprecated('Use [writeFileBytes] instead. It is the same method with a different name. The [writeFileSync] is confusing because it is not synchronous.')
Future<SafNewFile> writeFileSync(
  1. String treeUri,
  2. String fileName,
  3. String mime,
  4. Uint8List data, {
  5. bool? overwrite,
  6. bool? append,
})

Writes the given data to a file identified by the given treeUri, fileName and mime.

Returns a SafNewFile, which contains the Uri and file name of newly created file.

If overwrite is true, the file will be overwritten if it already exists. If overwrite is false and a file with the same name already exists, a new name will be generated and returned in the resulting SafNewFile. If append is true, the data will be appended to the file if it already exists.

Implementation

@Deprecated(
  'Use [writeFileBytes] instead. It is the same method with a different name. The [writeFileSync] is confusing because it is not synchronous.',
)
Future<SafNewFile> writeFileSync(
  String treeUri,
  String fileName,
  String mime,
  Uint8List data, {
  bool? overwrite,
  bool? append,
}) async {
  return SafStreamPlatform.instance.writeFileBytes(
    treeUri,
    fileName,
    mime,
    data,
    overwrite: overwrite,
    append: append,
  );
}