Conversation
There was a problem hiding this comment.
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;
}
}
There was a problem hiding this comment.
or maybe "withName" or "hasName" rather than "matches"
There was a problem hiding this comment.
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.
|
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. |
c7e896c to
f0be1dd
Compare
predicate(currentRoute)returns true.Fixes #5159
Fixes #5103