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 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
| Future _createSelectViewWithContext() async { RenderBox renderBox = context.findRenderObject(); var screenSize = renderBox.size; final option = await showModalBottomSheet( context: context, builder: (BuildContext context) { return StatefulBuilder(builder: (context, state) { return Stack( alignment: AlignmentDirectional.topCenter, children: <Widget>[ Container( color: Colors.black54, height: screenSize.height * 0.37, width: double.infinity, ), Container( height: screenSize.height * 0.35, width: screenSize.width * 0.95, decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(20.0))), child: Column( children: <Widget>[ Text( 'This is a title', style: TextStyle(color: Colors.grey, fontSize: 25), ), Divider(), Expanded( child: ListView( children: <Widget>[ ListTile( leading: Icon(Icons.home), title: Text('home'), trailing: RaisedButton( onPressed: () {}, color: Colors.blue, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(20)), child: Text('botton')), ), ListTile( leading: Icon(Icons.hotel), title: Text('hotel'), trailing: RaisedButton( onPressed: () {}, color: Colors.blue, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(20)), child: Text('botton')), ), ], )) ], ), ) ]); }); }); }
|