ProviderObserver does not return provider name. #1458
infolinematrix
started this conversation in
General
Replies: 1 comment 1 reply
-
You have to define one on your provider: Provider(..., name: 'Hello') |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
class RiverpodLogger extends ProviderObserver {
@OverRide
void didUpdateProvider(
ProviderBase provider,
Object? previousValue,
Object? newValue,
ProviderContainer container,
) {
if (kDebugMode) {
if (newValue is StateController) {
print('''
======
"provider": "${provider.name ?? provider.runtimeType}",
"newValue": "${newValue.state}"
======''');
}
}
}
}
#------------------------
provider.name always return null. How do I get provider name? please help
Beta Was this translation helpful? Give feedback.
All reactions