buildWidget method

  1. @override
Widget? buildWidget(
  1. BuildContext context,
  2. GoRouterState state,
  3. ShellRouteContext shellRouteContext
)
override

Attempts to build the Widget representing this shell route.

Returns null if this shell route does not build a Widget, but instead uses a Page to represent itself (see buildPage).

Implementation

@override
Widget? buildWidget(BuildContext context, GoRouterState state,
    ShellRouteContext shellRouteContext) {
  if (builder != null) {
    final Widget navigator = shellRouteContext._buildNavigatorForCurrentRoute(
        observers, restorationScopeId);
    return builder!(context, state, navigator);
  }
  return null;
}