createSearchRoute static method

GoRoute createSearchRoute({
  1. String? path,
  2. Widget builder(
    1. BuildContext,
    2. GoRouterState
    )?,
})

Creates a GoRoute for the search screen.

This route supports deep-linking with query parameters. For example: /search?q=flutter will open the search screen with "flutter" pre-filled.

Implementation

static GoRoute createSearchRoute({
  String? path,
  Widget Function(BuildContext, GoRouterState)? builder,
}) {
  return GoRoute(
    path: path ?? searchPath,
    builder: builder ?? _defaultSearchBuilder,
  );
}