add<T extends ChangeNotifier> method

T add<T extends ChangeNotifier>(
  1. T data
)

Adds a ChangeNotifier to this scope and returns it.

The notifier will be automatically disposed when this scope is disposed.

Example:

final liveData = scope.add(MutableLiveData(42));

Implementation

T add<T extends ChangeNotifier>(T data) {
  _items.add(data);
  return data;
}