Skip to content

[go_router] Update previous page on pop #100969

@jmysliv

Description

@jmysliv

Use case

I've noticed that currently is not possible to pass data with context.pop to somehow update/refresh the previous page. I know something similar could be achieved using context.goNamed but using it will clear the whole stack, and recreate it from the path, which is not always something desirable.

Proposal

The solution could be to update the previous page with the new queryParams, data etc.
The API could look like this:

 void popAndUpdate({
    Map<String, String> params = const <String, String>{},
    Map<String, String> queryParams = const <String, String>{},
    Object? extra,
  }) =>
     // TODO

Such a method could pop the current page and updates the previous one with passed arguments, so it could be refreshed.

Metadata

Metadata

Assignees

No one assigned

    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