overrideCreator method

  1. @protected
  2. @visibleForTesting
void overrideCreator(
  1. CreatorCallback<E, A> callback, {
  2. bool? autoDispose,
})

For testing use this to override a provider behavior

Implementation

@protected
@visibleForTesting
void overrideCreator(
  CreatorCallback<E, A> callback, {
  bool? autoDispose,
}) {
  // ignore: invalid_use_of_protected_member
  _creator.overrideCreator(
    callback,
    autoDispose: autoDispose,
  );

  ProvidersContainer.instance.overriddenCreators.putIfAbsent(
    _creator.hashCode,
    () => _creator,
  );
}