sharableFile function

Future<File> sharableFile({
  1. required Uint8List bytes,
  2. required String name,
})

Implementation

Future<File> sharableFile({
  required Uint8List bytes,
  required String name,
}) async {
  final base = await _cleanAtStartup;

  final dir = base.dir(dtbRandomString());
  await dir.create(recursive: true);

  final file = dir.file(name);
  await file.writeAsBytes(bytes);

  return file;
}