一、flutter没有底部dialog之说,但是有一个bottomsheet,flutter和安卓ios最大的不同是,它是在移动系统已经发展非常成熟的时候出现的,所以大多数的功能,比如UI,集成得非常好
void _modalBottomSheetMenu(){
showModalBottomSheet(
context: context,
builder: (builder){
return new Container(
height: 350.0,
color: Colors.transparent, //could change this to Color(0xFF737373),
//so you don't have to change MaterialApp canvasColor
child: new Container(
decoration: new BoxDecoration(
color: Colors.white,
borderRadius: new BorderRadius.only(
topLeft: const Radius.circular(10.0),
topRight: const Radius.circular(10.0))),
child: new Center(
child: new Text("This is a modal sheet"),
)),
);
}
);
}
二、
floatingActionButton: new FloatingActionButton(
onPressed: () {
showModalBottomSheet(
context: context,
builder: (BuildContext context){
return new Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
new ListTile(
leading: new Icon(Icons.photo_camera),
title: new Text("Camera"),
onTap: () async {
imageFile = await ImagePicker.pickImage(source: ImageSource.camera);
Navigator.pop(context);
},
),
new ListTile(
leading: new Icon(Icons.photo_library),
title: new Text("Gallery"),
onTap: () async {
imageFile = await ImagePicker.pickImage(source: ImageSource.gallery);
Navigator.pop(context);
},
),
],
);
}
);
},
foregroundColor: Colors.white,
child: Text('点我'),
),