0
我已成功導航到新文件中的類,但現在我沒有在我的appBar上獲得後退按鈕。下面是我的main.dart導航...Flutter appBar Backbutton does not appear
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),
),
),