of static method

get instance routerDelegate from context

Implementation

static BaseRouterDelegate? of(BuildContext context) {
  final delegate = Router.of(context).routerDelegate;
  if (delegate is BaseRouterDelegate) {
    return delegate;
  }
  assert(() {
    throw FlutterError(
        // ignore: lines_longer_than_80_chars
        'Router operation requested with a context that does not include a BaseRouterDelegate.\n');
  }(),
      // ignore: lines_longer_than_80_chars
      'Router operation requested with a context that does not include a BaseRouterDelegate.\n');
  return null;
}