Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow any Route to be offstage for an undetermined period of time #31972

Open
rrousselGit opened this issue May 2, 2019 · 0 comments
Open

Allow any Route to be offstage for an undetermined period of time #31972

rrousselGit opened this issue May 2, 2019 · 0 comments
Labels
c: proposal A detailed proposal for a change to Flutter f: routes Navigator, Router, and related APIs. framework flutter/packages/flutter repository. See also f: labels. P3 Issues that are less important to the Flutter project team-framework Owned by Framework team triaged-framework Triaged by Framework team

Comments

@rrousselGit
Copy link
Contributor

rrousselGit commented May 2, 2019

Note: I plan on implementing this feature myself, but it will likely require a breaking change, and the change is not trivial.

Use case

A package I'm working on needs to act as a man in the middle between a Navigator.push and the appearance of the route on the screen.

The idea is, a NavigatorObserver may force pushed routes to be in an offstage state similarly to how Hero works. But that offstage status may last for a lot longer than one frame. In the meantime, the previous route should stay visible and interactive.

Currently, doing so leads to a black screen.

Proposal

  • move offstage property from ModalRoute to Route.
  • offstage routes do not make the previous route invisible even if they are opaque.
  • offstage routes don't capture clicks.
  • going from offstage to onstage must not destroy the Route state.
  • a route that was never rendered as onstage before should correctly start its transition animation from 0 when it appears
  • routes may be popped when offstage

Misc:

  • HeroController may mess up with the opaque variable.
  • We'll probably want to move the "animation should start only when the route becomes onstage" out of HeroController and into Route itself.
@Piinks Piinks added f: routes Navigator, Router, and related APIs. framework flutter/packages/flutter repository. See also f: labels. labels Jun 24, 2019
@VladyslavBondarenko VladyslavBondarenko added the c: proposal A detailed proposal for a change to Flutter label Jul 14, 2020
@goderbauer goderbauer added the P3 Issues that are less important to the Flutter project label Feb 7, 2023
@flutter-triage-bot flutter-triage-bot bot added team-framework Owned by Framework team triaged-framework Triaged by Framework team labels Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: proposal A detailed proposal for a change to Flutter f: routes Navigator, Router, and related APIs. framework flutter/packages/flutter repository. See also f: labels. P3 Issues that are less important to the Flutter project team-framework Owned by Framework team triaged-framework Triaged by Framework team
Projects
None yet
Development

No branches or pull requests

4 participants