writeToFile2 function

dynamic writeToFile2(
  1. String imageBytes,
  2. String file
)

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