writeToImageFile method

Future<File> writeToImageFile(
  1. Uint8List data,
  2. String nameFile, {
  3. String? path,
  4. String? docName,
})

Implementation

Future<File> writeToImageFile(Uint8List data, String nameFile,
    {String? path, String? docName}) async {
  var filePath = "";
  if (path == null)
    filePath = await generatePath(docName ?? "Doc") + nameFile;
  else
    filePath = path + nameFile;

  return new File(filePath).writeAsBytes(data);
}