listenSelf abstract method

void listenSelf(
  1. void listener(
    1. State? previous,
    2. State next
  2. {void onError(
    1. Object error,
    2. StackTrace stackTrace

Listens to changes on the value exposed by this provider.

The listener will be called immediately after the provider completes building.

As opposed to listen, the listener will be called even if ProviderElementBase.updateShouldNotify returns false, meaning that the previous and new value can potentially be identical.


void listenSelf(
  void Function(State? previous, State next) listener, {
  void Function(Object error, StackTrace stackTrace)? onError,