of static method

Implementation

static ActivityRouter of(BuildContext context) {
  final scope = context.dependOnInheritedWidgetOfExactType<_RouterScope>();
  if (scope == null) throw StateError('No ActivityRouter found in context');
  return scope.router;
}