How to navigate to new widget as a child in widget tree in Flutter

107 views
Skip to first unread message

Rakesh Singh

unread,
Jan 15, 2022, 11:02:04 AM1/15/22
to Flutter Development (flutter-dev)

when I push new MaterialPageRoute "Child" it is created on the same level as MyApp widget in the Flutter widget tree. I would like to have it as a child of widget MyApp, so MyApp would be a parent of Child widget.

code link: https://dartpad.dev/?id=6fcea318ad98bc798f1360d52b805fb2

The current widget tree structure is as follow-

As you can see "Child" widget is sibling of Scaffold but I want it to be child of Scaffold.


Screenshot 2022-01-15 213013.png

Reply all
Reply to author
Forward
0 new messages