人家的页面写好都直接有返回图标,为什么我的被狗叼走了…生闷气
就是左边的这个返回按钮,没有就只能自己写了呗
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
leading: new IconButton(
//这是图标长按会出现的提示信息,返回按钮这么常用,应该不需要吧
//tooltip: '返回上一页',
icon: const Icon(Icons.arrow_back),
onPressed: () {
Navigator.of(context).pop();
//_nextPage(-1);
},
),
),
)
}
flutter中路由的存放方式是栈, Navigator.of(context).pop(); 的意思是回退到栈中的上一级
欢迎大佬指正