@TOCScaffold
Scaffold属性
appBar
导航栏
appBar: new AppBar(
title: new Text('welcome to flutter'),
leading: new Icon(Icons.home),
actions: <Widget>[
new IconButton(
icon: new Icon(Icons.add_alarm),
tooltip: 'Add Alarm',
onPressed: () {
}),
],
),
body
主体
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("welcome to flutter"),
),
body: Center(
child: Text('Hello Flutter'),
),
);
}
}
floatingActionButton
一个悬浮在body上的按钮,默认显示在右下角
floatingActionButton: FloatingActionButton(
onPressed: (