loadFromRootAsJSON method Null safety

Future<void> loadFromRootAsJSON(
  1. String fullPath,
  2. String id
)

Implementation

static Future<void> loadFromRootAsJSON(String fullPath, String id) async {
  try {
    String raw = await rootBundle.loadString(fullPath);
    Map<String, dynamic> map = jsonDecode(raw);
    _json[id] = map;
  } catch (e) {
    throw e;
  }
}