didUpdateProvider method
Called by providers when they emit a notification.
newValue
will benull
if the provider threw during initialization.previousValue
will benull
if the previous build threw during initialization.
Implementation
@override
@mustCallSuper
void didUpdateProvider(
ProviderBase<Object?> provider,
Object? previousValue,
Object? newValue,
ProviderContainer container,
) {
super.didUpdateProvider(provider, previousValue, newValue, container);
if (!settings.enabled || !settings.printProviderUpdated) {
return;
}
final accepted = settings.providerFilter?.call(provider) ?? true;
if (!accepted) {
return;
}
_talker.logTyped(
RiverpodUpdateLog(
provider: provider,
previousValue: previousValue,
newValue: newValue,
settings: settings,
),
);
}