loadFileDirectly static method
loads json cached file with a name
Implementation
static Future<Map<String, dynamic>?> loadFileDirectly({required String cachedFileName}) async {
File jsonFile;
Map<String, dynamic>? _file;
var tempDir = await getApplicationDocumentsDirectory();
String _filePath = tempDir.path + '/$cachedFileName.json';
jsonFile = new File(_filePath);
if (jsonFile.existsSync()) {
_file = json.decode(jsonFile.readAsStringSync());
return _file;
}
}