change method

Future<void> change(
  1. CollectionChangeType type,
  2. T? model
)

Implementation

Future<void> change(CollectionChangeType type, T? model) async {
  for (String controllerId in _controllerListener) {
    await Controller.get(id: controllerId)
        .listenedCollectionChanged(controllerId);
  }

  List<Map<String, dynamic>> collectionBuilderListener = [];

  collectionBuilderListener.addAll(_collectionBuilderListener.values);

  for (Map<String, dynamic> listener in collectionBuilderListener) {
    listener['callback']();
  }

  await onChanged(type, model);
}