Skip to content

[go_router] avoid exposing goBranch from StatefulNavigationShell #128262

@chunhtai

Description

@chunhtai

Is there an existing issue for this?

Use case

StatefulNavigationShell is a widget that is built in StatefulShellRoute. It has a goBranch method on the widget itself

https://pub.dev/documentation/go_router/latest/go_router/StatefulNavigationShell/goBranch.html

This is unsafe as a widget class can be reused multiple time in a screen. Although it is not an issue now, it can be a foot gun if someone refactor it in the future without knowing this method exists.

Proposal

We should find a new way to expose this API.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectp: go_routerThe go_router packagepackageflutter/packages repository. See also p: labels.team-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework team

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions