Skip to content

[go_router] Allows redirect only GoRoute in RouteMatchList #114807

@livtanong

Description

@livtanong

The documentation for GoRoute's constructor says:
- One of either [builder] or [pageBuilder] must be provided.

Suggesting that builder must be provided even if redirect is provided.

However, the assertions seem to indicate that it's okay to forgo passing builder as long as redirect is provided:

assert(pageBuilder != null || builder != null || redirect != null,
            'builder, pageBuilder, or redirect must be provided'),

In practice, I get "No routeBuilder provided to GoRoute" if I provide redirect but not builder, so that seems to support the constructor's documentation rather than the assertions. If this is all intentional, then perhaps the assertion should be updated to

assert(pageBuilder != null || builder != null,  'builder or pageBuilder must be provided)

Metadata

Metadata

Assignees

Labels

P0Critical issues such as a build break or regressionp: go_routerThe go_router packagepackageflutter/packages repository. See also p: labels.

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions