of static method

BrowserConfig of(
  1. BuildContext context, {
  2. bool build = false,
})

Implementation

static BrowserConfig of(BuildContext context, {bool build = false}) {
  final conf = build
      ? context.dependOnInheritedWidgetOfExactType<BrowserConfig>()
      : context.findAncestorWidgetOfExactType<BrowserConfig>();

  if (conf == null) {
    throw FlutterError('''
      BrowserConfig.of() called with a context that does not contain a config.

      The widget used was: ${context.widget.runtimeType}.
      ''');
  }

  return conf;
}