addNested method

void addNested(
  1. ReactiveModel nested, {
  2. Symbol? field,
})

Implementation

void addNested(ReactiveModel nested, {Symbol? field}) {
  if (_nestedModels.contains(nested)) return;
  _nestedModels.add(nested);

  nested.addListener(() {
    if (debugNotify) {
      debugPrint(
        'Nested change: ${nested.runtimeType} -> ${field ?? #nested}',
      );
    }
    notifyListeners(field ?? #nested);
  });
}