setup method Null safety

Future<void> setup()

Setup JSONHandler

  • Load all Files defined in .env file JSON_FILES

Implementation

static Future<void> setup() async {
  try {
    for (String file in Environment.getList("JSON_FILES")) {
      String raw = await rootBundle.loadString(Resources.getJSONPath(file));
      Map<String, dynamic> map = jsonDecode(raw);
      _json[file] = map;
    }
  } catch (e) {
    throw e;
  }
}