of<S extends SlicesState> static method

SlicesStore<S> of<S extends SlicesState>(
  1. BuildContext context
)

Implementation

static SlicesStore<S> of<S extends SlicesState>(BuildContext context) {
  final widget =
      context.dependOnInheritedWidgetOfExactType<SlicesProvider<S>>();

  if (widget == null) {
    throw 'No SlicesProvider available on the tree';
  }

  return widget.store;
}