Closed DelcoigneYves closed 2 months ago
Just FYI: I'm off on holiday till next week. I'll take a look then!
My first reaction is that it would be better to have a method like this:
.popUntil((l) {
return l is HomeLocation ? true : false;
}
thoughts?
True, this mirrors the Navigator's popUntil more as well. I guess I was focusing too much on the type being the main filter to be added. I'll update the implementation with your suggestion!
PR is updated 🙏
Description
As mentioned in #24, it was a bit of a weird interface to have to instantiate a new location to use in the popUntil method (especially if this Location needed parameters). So instead, popUntil is now a generic method, where the passed type is the type of the location to pop to.
I was scratching my head a bit for checking whether the passed type was actually a subtype of Location: when forgetting to add the type, the runtime type was just Location, and so it would pop to the first Location it found. Let me know if you can think of a better solution.
Related Issues
24
Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?