create method
Initialize a provider.
This function must call setState or throw (or both).
Exceptions within this function will be caught and set the provider in error state. Then, reading this provider will rethrow the thrown exception.
didChangeDependency
can be used to differentiate a rebuild caused by watch from one caused by refresh/invalidate.
Implementation
@override
void create({required bool didChangeDependency}) {
asyncTransition(AsyncLoading<T>(), seamless: !didChangeDependency);
_streamNotifier.result ??= Result.data(_streamController.stream);
handleStream(
() {
final provider = this.provider as _StreamProviderBase<T>;
return provider._create(this);
},
didChangeDependency: didChangeDependency,
);
}