of static method
- BuildContext context
Looks up the nearest router, including inside independently nested stacks.
Implementation
static RouteDefinerRouter of(BuildContext context) {
final router = maybeOf(context);
if (router == null) {
throw FlutterError('No RouteDefinerRouter found above this context. '
'Use a context inside a screen managed by RouteDefinerRouter.');
}
return router;
}