Skip to content

[animations] - callback (or similar) when user navigates back to closedBuilder #51458

Description

@ben04

I'm using the new animations package.

Use case

The user opens the second page, enters information which, after navigating back to the first page, must be available on this first page.

Old way

So far, without the animations package, I just put a 'await' before the Navigator.push() and could call the method, which should be executed when the user navigates back, after that statement.

await Navigator.push(
      context,
      MaterialPageRoute(builder: (context) => DetailView()),
    );
loadData();

Proposal / Question?

How is that possible with the animations package? The Navigator.push() method is called within a void method, so I can't wait for that. I haven't found any other way to do that so far.

Activity

  1. esDotDev commented on Mar 1, 2020

    @esDotDev

    Also would be nice to somehow get the pop results.

  2. goderbauer commented on Mar 30, 2020

    @goderbauer
    Member

    The action callback supplied to the closedContainer builder could return the Future from Navigator.push:

    https://github.com/flutter/packages/blob/c1a2bf88dfd6c2667c50cdfba690279c480a57a6/packages/animations/lib/src/open_container.dart#L224

    This should be an easy change.

  3. added
    packageflutter/packages repository. See also p: labels.
    and removed on Mar 30, 2020
  4. self-assigned this
    on Apr 13, 2020
  5. github-actions commented on Aug 22, 2021

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  6. locked as resolved and limited conversation to collaborators on Aug 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

c: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterp: animationsThe animations packagepackageflutter/packages repository. See also p: labels.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions