1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
| class Home extends StatelessWidget { void _showSettingsPanel(context) { showBottomSheet( context: context, builder: (context) { return Container( color: Colors.orange, padding: EdgeInsets.symmetric(vertical: 20.0, horizontal: 150.0), child: Text('bottom sheet'), ); }); }
@override Widget build(BuildContext context) { return MaterialApp( home: Scaffold( backgroundColor: Colors.brown[50], appBar: AppBar( title: Text('Flutter'), backgroundColor: Colors.brown[400], elevation: 0.0, actions: <Widget>[ FlatButton.icon( onPressed: () async {}, icon: Icon(Icons.person), label: Text('Log Out')), Builder(builder: (context) { return FlatButton.icon( icon: Icon(Icons.settings), label: Text('settings'), onPressed: () => _showSettingsPanel(context), ); }) ], ), body: Text(""), ), ); } }
|