To keep NavigationRail
after push, use nested navigator:
Scaffold(
body: Row(
children: [
NavigationRail(
// ...
),
VerticalDivider(),
Expanded(
child: ClipRect(
child: Navigator(
onGenerateRoute: (settings) => MaterialPageRoute(
builder: (context) => Parent(),
),
),
),
),
],
),
)
Then pushing from Parent
will replace screen part only inside the Navigator
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…