register static method

Future<void> register(
  1. Controller controller
)

Implementation

static Future<void> register(Controller controller) async {
  String id = controller.runtimeType.toString();

  _controllers[id] = controller;

  await _controllers[id].registerController();

  List<Type> listenedCollections = controller.getListenedCollections();

  for (Type listenedCollection in listenedCollections) {
    Collection.get(id: listenedCollection.toString())
        .registerControllerListener(id);
  }
}