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
          ),
        ],
      );
    }
);
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章