Skip to content

Pesto home stack - #5168

Merged
HansMuller merged 5 commits into
flutter:masterfrom
HansMuller:pesto_home_stack
Aug 1, 2016
Merged

HansMuller merged 5 commits into
flutter:masterfrom
HansMuller:pesto_home_stack

Conversation

@HansMuller

Copy link
Copy Markdown
Contributor
  • Navigator.popUntil() applies pop() until predicate(currentRoute) returns true.
  • Revised pesto route popping and pushing procedures

Fixes #5159
Fixes #5103

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should provide a currying function that returns this predicate...

So this becomes:

Navigator.popUntil(context, ModalRoute.matches('/pesto'));
// in ModalRoute:
static RoutePredicate matches(String routeName) {
  return (Route<dynamic> route) {
    return !route.willHandlePopInternally && route is ModalRoute && route.settings.name == routeName;
  }
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or maybe "withName" or "hasName" rather than "matches"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd thought about providing a utility function ModalRoute.withName(route, name) but it didn't seem useful enough. A ModalRoute.withName(name) that returns a predicate (and factors in willHandlePopInternally, which would be the common case) would be pretty slick.

@Hixie

Hixie commented Aug 1, 2016

Copy link
Copy Markdown
Contributor

add a gallery test that checks that the drawer works as expected in pesto (i.e. that the bugs are fixed, and that routes don't stack up).

add a framework test that checks that popUntil works correctly around local history routes.

@Hixie

Hixie commented Aug 1, 2016

Copy link
Copy Markdown
Contributor

LGTM

@HansMuller
HansMuller merged commit 56a2d22 into flutter:master Aug 1, 2016
@HansMuller
HansMuller deleted the pesto_home_stack branch August 1, 2016 22:10
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Aug 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gallery Pesto: homes stack up Gallery, Pesto: back button does nothing after going home from drawer

2 participants