writeToFile2 function
Implementation
writeToFile2(String imageBytes, String file) async {
Directory? tempDir = await getExternalStorageDirectory();
String? tempPath = tempDir?.path;
var filePath =
tempPath! + '/' + file; // file_01.tmp is dump file, can be anything
return new File(filePath).writeAsString(imageBytes);
}