Could you please to explain if we need to create a new GoRoute
for each new navigation item?
Let's say I have a bottom navigation where I use GoRouter
with StatefulShellRoute
with major routes like
Dashboard * Users * Accounts
Let's say the user taps on Accounts
(=/accounts
), then he taps on item and goes deeper to AccountDetailView
(=/accounts/1
) which contains a button Edit
which should direct user to AccountEditView
(=/accounts/1/edit
). The edit widget can navigate to new routes AccountEditApiKey
(=/accounts/1/edit/api
) and AccountEditDescription
(=/accounts/1/edit/description
).
And question is should we create the new GoRoute
for each navigation route?
GoRoute(
path: `/accounts`,
builder: (...) => Accounts(),
routes: [
GoRoute(
path: `:id`,
builder: (...) => AccountDetailView(),
routes: [
GoRoute(
path: `edit`,
builder: (...) => AccountEditView(),
routes: [
GoRoute(
path: `api`,
builder: (...) => AccountEditApiKeyView(),
routes: [
],
),
GoRoute(
path: `description`,
builder: (...) => AccountEditDescriptionView(),
routes: [
],
),
... potentially other screens
],
),
],
),
]
),
// other routes for entities
But if I have dozens entities which may have many nested navigation then how big my routing table becomes?
Is it possible to use navigation 1.0 Navigator.push(context, MaterrialPageRoute(...))
and Navigator.pop
for navigation items like AccountEditApiKeyView
and AccountEditDescriptionView
? And how this will work with route restoration?
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745267308a4619534.html
评论列表(0条)