【发布时间】:2018-02-08 19:00:01
【问题描述】:
我已成功导航到新文件中的类,但现在我的 appBar 上没有返回按钮。这是我在 main.dart 中的导航...
new RaisedButton(
onPressed: () {
Navigator.pushNamed(context, '/searchpage');
},
这是我的 SearchPage appBar..
class SearchPageState extends State<SearchPage> {
@override
Widget build(BuildContext context) {
return new MaterialApp(
routes: <String, WidgetBuilder>{
'/loginpage': (BuildContext context) => new Login.LoginPage(),
'/mainpage': (BuildContext context) => new Main.MyApp(),
},
home: new Scaffold(
appBar: new AppBar(
title: new Text(
"Search",
style: new TextStyle(fontWeight: FontWeight.bold),
),
),
【问题讨论】:
-
检查附加链接中的 Sameh Khemira 答案。 stackoverflow.com/a/60097799/17211037
标签: class navigation flutter appbar