save static method

Future<String> save(
  1. Uint8List bytes,
  2. String fileName
)

Writes bytes to a unique file name and returns the saved file path.

Implementation

static Future<String> save(
  Uint8List bytes,
  String fileName,
) async {
  final directory = await _targetDirectory();
  final file = await _uniqueFile(directory, fileName);
  await file.writeAsBytes(bytes, flush: true);
  return file.path;
}