autoDisposeNotifier<N extends ChangeNotifier?> method

  1. @visibleForTesting
  2. @protected
N autoDisposeNotifier<N extends ChangeNotifier?>(
  1. N ntf, {
  2. String? tag,
})

Implementation

@visibleForTesting
@protected
N autoDisposeNotifier<N extends ChangeNotifier?>(N ntf, {String? tag}) {
  if (ntf == null) return ntf;
  _autoDisposeNotifiers ??= <String, ChangeNotifier>{};
  tag ??= '${ntf.hashCode}';
  _autoDisposeNotifiers![tag] = ntf;
  return ntf;
}