writeToImageFile method
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);
}