saveFile method

bool saveFile({
  1. required Map<String, dynamic> file,
  2. required String cachedFileName,
})

save json file in cache(temp directory) with with given name using instance member

Implementation

bool saveFile({
  required Map<String, dynamic> file,
  required String cachedFileName})

{
  File jsonFile;
  String _filePath = tempDirectory.path + '/$cachedFileName.json';
  jsonFile = new File(_filePath);
  jsonFile.writeAsStringSync(json.encode(file));
  return true;
}