didUpdateProvider method

  1. @override
void didUpdateProvider(
  1. ProviderBase provider,
  2. Object? previousValue,
  3. Object? newValue,
  4. ProviderContainer container,
)

Called by providers when they emit a notification.

  • newValue will be null if the provider threw during initialization.
  • previousValue will be null if the previous build threw during initialization.

Implementation

@override
void didUpdateProvider(ProviderBase provider, Object? previousValue,
    Object? newValue, ProviderContainer container) {
  _storage.addSimpleLog(SimpleOverlayLog(
    timestamp: DateTime.now(),
    tag: provider.name ?? provider.runtimeType.toString(),
    level: LogLevel.debug,
    message: 'Updated: $newValue',
  ));
}