getConfigFile static method

Future<Map<String, dynamic>> getConfigFile()

Implementation

static Future<Map<String, dynamic>> getConfigFile() async {
  String path = "todo.json";
  File jsonFile = File(path);

  if (!await jsonFile.exists()) {
    print(
        "ERROR: Configuration file 'todo.json' not found on project root folder");
    exit(1);
  }
  Map<String, dynamic> jsonDecoded =
      jsonDecode(await jsonFile.readAsString());
  return jsonDecoded;
}