of static method

Implementation

static BottomNavigationController of(BuildContext context) {
  final _BottomNavigationControllerScope? scope = context
      .dependOnInheritedWidgetOfExactType<_BottomNavigationControllerScope>();
  if (scope == null) {
    throw StateError(
      'DefaultBottomNavigationController.of() called with a context that does not contain a Scaffold.',
    );
  }
  return scope.controller;
}