of<S> static method

Store<S> of<S>(
  1. BuildContext context
)

Implementation

static Store<S> of<S>(BuildContext context) {
  try {
    return Provider.of<Store<S>>(context, listen: false);
  } on ProviderNotFoundException catch (_) {
    throw FlutterError(
      """
        Store of state "${S.runtimeType}" is not found within this BuildContext
        Make sure, that this widget is a child of StoreProvider<${S.runtimeType}>
      """,
    );
  }
}