dependOnProvidedStoreOfExactType<T extends Store> method

T dependOnProvidedStoreOfExactType<T extends Store>()

Returns the first Store with the exact type T provided by the nearest parent Provider.

Also, if the Provider is updated, the widget owning this context is rebuilt.

Implementation

T dependOnProvidedStoreOfExactType<T extends Store>() => Provider.of(this)
    .stores
    .firstWhere((final store) => store.runtimeType == T) as T;