buildPage method

  1. @visibleForTesting
Page<Object?> buildPage(
  1. BuildContext context,
  2. GoRouterState state,
  3. Widget child
)

builds the page based on app type, i.e. MaterialApp vs. CupertinoApp

Implementation

@visibleForTesting
Page<Object?> buildPage(
  BuildContext context,
  GoRouterState state,
  Widget child,
) {
  // build the page based on app type
  _cacheAppType(context);
  return _pageBuilderForAppType!(
    key: state.pageKey,
    name: state.name ?? state.path,
    arguments: <String, String>{
      ...state.pathParameters,
      ...state.uri.queryParameters
    },
    restorationId: state.pageKey.value,
    child: child,
  );
}