didUpdateProvider method
- ProviderBase<
Object?> provider, - Object? previousValue,
- Object? newValue,
- ProviderContainer container
override
Called by providers when they emit a notification.
newValuewill benullif the provider threw during initialization.previousValuewill benullif the previous build threw during initialization.
Implementation
@override
void didUpdateProvider(
ProviderBase<Object?> provider,
Object? previousValue,
Object? newValue,
ProviderContainer container,
) {
if (kDebugMode) {
final toPrint = '''
{
"provider": "${provider.name ?? provider.runtimeType}",
"newValue": "$newValue"
}''';
print(toPrint.substring(0, min(200, toPrint.length)));
}
}