- 使用Navigator命令来管理和操控路由堆栈。
navigator.push添加路由至堆栈,显示新路由页面。navigator.pop移除路由堆栈中最后一个路由,返回到上一个页面。- 创建名为
abot的小部件,其中包含使用column等组件布局以及text和text button小部件。 - 使用
MaterialPageRoute作为路由,通过Builder返回about小部件。 - 添加在
about组件中的按钮可通过navigator.pop返回上一页面。 - 如果设置了
AppBar,会自动添加返回按钮,点击时亦执行navigator.pop。