buildPage method

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

Attempts to build the Page representing this shell route.

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

Implementation

@override
Page<dynamic>? buildPage(BuildContext context, GoRouterState state,
    ShellRouteContext shellRouteContext) {
  if (pageBuilder != null) {
    final Widget navigator =
        shellRouteContext.navigatorBuilder(observers, restorationScopeId);
    return pageBuilder!(context, state, navigator);
  }
  return null;
}