of static method
Access Beamer's routerDelegate.
Implementation
static BeamerDelegate of(BuildContext context, {bool root = false}) {
BeamerDelegate _delegate;
try {
_delegate = Router.of(context).routerDelegate as BeamerDelegate;
} catch (e) {
assert(BeamerProvider.of(context) != null,
'There was no Router nor BeamerProvider in current context. If using MaterialApp.builder, wrap the MaterialApp.router in BeamerProvider to which you pass the same routerDelegate as to MaterialApp.router.');
return BeamerProvider.of(context)!.routerDelegate;
}
if (root) {
return _delegate.root;
}
return _delegate;
}