Skip to content

Fold StateRoute concept into a feature of ModalRoute #553

@Hixie

Description

@Hixie

With removeRoute(), we have a way to remove StateRoutes in a random-access manner. Doesn't work with other kinds of routes really.
With didPopNext/willPushNext, we have a bunch of machinery just to deal with walking past StateRoutes.
With replaceRoute(), we have a way to replace a route with another. Doesn't really work if you replace a StateRoute with a non-StateRoute or vice versa.
With removeRouteBefore(), things will break if you remove a non-StateRoute between two StateRoutes.

Generally this needs cleaning up. I propose that we make Routes be able to say "nevermind, I handled it" when told to pop(). Then you just need a way to push state into the current route (using ModalRoute.of() maybe).

It's not clear to me what it means for a route not to be modal in this world, though. Maybe it doesn't mean anything. Only Drawer would be left doing that, I think, and it's still modal.

Metadata

Metadata

Assignees

Labels

c: contributor-productivityTeam-specific productivity, code health, technical debt.frameworkflutter/packages/flutter repository. See also f: labels.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions