addModelsFromJson method

void addModelsFromJson(
  1. Map<String, dynamic> data
)

Go through the data and create instances for each model and add them to the internal list. Also listens for change events for each created model.

Implementation

void addModelsFromJson(Map<String, dynamic> data) {
  for (var collection in data["collections"][rid] as Iterable) {
    var rid = collection["rid"] as String;
    var model = (data["models"][rid]) as Map<String, dynamic>;
    var instance = createModelFromJson(rid, model);
    models.add(instance);
  }
}