您可以在此处尝试使用该软件包:
https://pub.dev/packages/sliding_up_panel
但是,如果这不能满足您的需要,请尝试以下操作:用GestureDetector和AnimatedController将小部件包裹起来:
double containerHeight = 0;
GestureDetector(
onVerticalDragEnd: (dragUpdateDetails) {
setState(){
containerHeight = //device height or use MediaQuery.of(context).size.height//
}
},
child: AnimatedContainer(
duration: Duration(milliseconds: //how long should it take//),
height: containerHeight,
child: //whatever you want//
)
),
AnimatedController在属性更改之间自动设置动画。但是,您可能希望尝试将onVertivalDragEnd更改为类似onVerticalDragUpdate之类的内容,以完全满足您的愿望。如果要在全屏模式下使用该行为,请使用GestureDetector包装您的第一个返回Widget。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句