Skip to content

[go_router] Support passing extra object alongside initialLocation while creating GoRouter #122780

@sarbagyastha

Description

@sarbagyastha

Use case

Currently only initialLocation can be passed while creating a GoRouter instance. There is no way to pass extra object.
This should mostly be useful in scenario when there are nested routers or in tests.

Proposal

A new param can be added to GoRouter, named initialExtra.

GoRouter(
  initialLocation: '/dummy',
  initialExtra: ExtraDataForDummy(),
)

Metadata

Metadata

Assignees

Labels

P3Issues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterp: go_routerThe go_router packagepackageflutter/packages repository. See also p: labels.r: fixedIssue is closed as already fixed in a newer version

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions