readMap function
Implementation
Future<Map<String, dynamic>> readMap(file) async {
if (!await file.exists()) {
throw Exception('Map file does not exist! ${file.path}');
}
String contents = await file.readAsString();
return json.decode(contents);
}