Closed baueric closed 2 years ago
What you're doing should work just fine. Can you post a minimal repro?
If you're trying to build a stack of family|person|personMore, why not arrange your routes like this:
GoRoute(
name: 'family',
path: '/family/:familyId',
builder: (context, state) => FamilyPage(familyId: state.params['familyId']),
routes: [
GoRoute(
name: 'person',
path: '/person/:personId',
builder: (context, state) => PersonPage(personId: state.params['personId']),
routes: [
GoRoute(
name: 'personMore'
path: 'more-person-stuff'
builder: (context, state) => PersonMorePage(personId: state.params['personId']),
)
]
)
]
)
Now you can just goNamed('family')
, goNamed('person')
and goNamed('personMore')
and you'll get a stack of one, two or three pages as appropriate.
I think your example would work but I should have used different example objects than family
and person
because it's important the routes are not nested. I also want to use a push
action to add the nested route to my current stack and not a go
action. I will try to add a full example in the next day or two.
closing due to lack of customer input. feel free to reopen if you have a minimal repro of this issue.
Please let me know if I'm organizing my routes wrong but it seems like this should work. If you have these routes:
Here is what I'm experiencing:
person
page and do acontext.pushNamed('personMore', params: {'personId': 'person1'})
it works ✅family
page and do acontext.pushNamed('person', params: {'personId': 'person1'})
it works ✅family
page and do acontext.pushNamed('personMore', params: {'personId': 'person1'})
it does not work ❌For situation 3 I'm seeing the builder's
state.params
has value:{'familyId': 'family1'}
even though thestate.location
is'/person/person1/more-person-stuff'
. So it's odd to me that the location string is correct but the params is missing thepersonId
value. Any ideas?And thank you for creating this amazing router!