of static method
Get the nearest DBRouterDelegate from the provided context
.
Implementation
static DBRouterDelegate of(final BuildContext context, {bool root = false}) {
final NavigatorState navigator = Navigator.of(context, rootNavigator: root);
final RouterDelegate<dynamic> delegate =
Router.of(navigator.context).routerDelegate;
if (delegate is DBRouterDelegate) {
return delegate;
} else {
throw const DBRouterDelegateNotFoundException();
}
}