Manage you project Routes. Create nested routes. Simply navigation without context to your pages. Change only one sub widget in your page when navigating to new route.
I cannot figure out how to make replaceLastName work with nested navigation, need some help on that.
There is a root navigator and a a nested navigator. I want to open a page inside a tab in the nested navigator and then replace it with another page. I perform the following steps:
Open nested navigation page. Stack tree initially looks like this:
Key [-1] (Root)
Key [2] (bottom_bar_page)
Key [20] (bottom_bar_page)
Key [3] (home)
2. Open nested page over the home tab. Stack tree becomes this:
I cannot figure out how to make replaceLastName work with nested navigation, need some help on that. There is a root navigator and a a nested navigator. I want to open a page inside a tab in the nested navigator and then replace it with another page. I perform the following steps:
Key [20] (bottom_bar_page) Key [3] (home)
Key [-1] (Root) Key [2] (bottom_bar_page)
Key [20] (bottom_bar_page) Key [3] (home) Key [4] (internal)
Key [-1] (Root) Key [2] (bottom_bar_page)
Key [20] (bottom_bar_page) Key [4] (internal) Key [3] (home) Key [6] (dto)
Key [-1] (Root) Key [2] (bottom_bar_page)
Key [20] (bottom_bar_page) Key [3] (home) Key [6] (dto)
2 NavigatorState.initState (package:flutter/src/widgets/navigator.dart:3577:14)
3 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:5618:55)
4 ComponentElement.mount (package:flutter/src/widgets/framework.dart:5463:5)
... Normal element mounting (48 frames)
52 Element.inflateWidget (package:flutter/src/widgets/framework.dart:4340:16)
53 MultiChildRenderObjectElement.inflateWidget (package:flutter/src/widgets/framework.dart:6904:36)
54 MultiChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:6916:32)
... Normal element mounting (380 frames)
434 Element.inflateWidget (package:flutter/src/widgets/framework.dart:4340:16)
435 MultiChildRenderObjectElement.inflateWidget (package:flutter/src/widgets/framework.dart:6904:36)
436 Element.updateChild (package:flutter/src/widgets/framework.dart:3849:18)
437 Element.updateChildren (package:flutter/src/widgets/framework.dart:4036:32)
438 MultiChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6929:17)
439 Element.updateChild (package:flutter/src/widgets/framework.dart:3827:15)
440 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5512:16)
441 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5650:11)