/**
const BottomSheet({
Key key,
this.animationController,
this.enableDrag = true,
this.elevation = 0.0,
@required this.onClosing,
@required this.builder
})
*/
floatingActionButton: Builder(builder: (BuildContext context) {
return FloatingActionButton(
onPressed: () =>
Scaffold
.of(context)
.showBottomSheet<Null>(
(BuildContext context) {
return Container(
height: 300.0,
color: Color(0xffff0000),
);
})
//closed:当此对象控制的元素不可见时完成
// whenComplete:完成时调用的函数
.closed
.then((value) => print(value))
.whenComplete(() {
// mounted:bool值,这个State对象当前是否在结构树中
if (!mounted) {
print("已经不在结构树中了");
} else {
print("在结构树中");
}
}),
child: Text("click"),
);
})
网友评论