1. 程式人生 > >flutter showbottomsheet showmodalbottomsheet底部彈出框

flutter showbottomsheet showmodalbottomsheet底部彈出框

關閉的方法:向下滑動即可關閉。

 

onPressed: (){
           Scaffold.of(context).showBottomSheet((BuildContext context){
             return Row(
               mainAxisAlignment: MainAxisAlignment.spaceAround,
               children: <Widget>[
               IconButton(icon: Icon(Icons.shop_two), onPressed: (){

               }),
               IconButton(icon: Icon(Icons.shop_two), onPressed: (){

               })
             ],);
           });
       }),

showModalBottomSheet(
    context: context,
    builder: (BuildContext context){
      return new Column(
        mainAxisSize: MainAxisSize.min,
        children: <Widget>[
          new ListTile(
            leading: new Icon(Icons.video_library),
            title: new Text("視訊"),
            onTap: () async {
              Navigator.pop(context);
            },
          ),
          new ListTile(
            leading: new Icon(Icons.photo_library),
            title: new Text("圖片"),
            onTap: _selectImagesss
          ),
        ],
      );
    }
);