onDispose abstract method Null safety
- void cb(
Adds a listener to perform an operation right before the provider is destroyed.
- when the provider will rebuild (such as when using watch or refresh).
- when an
autoDisposeprovider is no longer used
- when the associated ProviderContainer/
- Provider.autoDispose, a modifier which tell a provider that it should destroy its state when no longer listened to.
- ProviderContainer.dispose, to destroy all providers associated with a ProviderContainer at once.
- onCancel, a life-cycle for when all listeners of a provider are removed.
void onDispose(void Function() cb);