Flutter 如何在颤振中从视图中推出图像?
我是新的颤振,我想知道如何实现这个设计在我的项目Flutter 如何在颤振中从视图中推出图像?,flutter,flutter-layout,flutter-animation,Flutter,Flutter Layout,Flutter Animation,我是新的颤振,我想知道如何实现这个设计在我的项目 如何变换/转换背景,使其从视图中向上或向外移动 如何在几毫秒后在我的背景上添加另一个容器(位于屏幕底部) 使用showModalBottomSheet。这里有一个例子 onPressed: () { showModalBottomSheet( context: context, builder: (BuildContext ctx) {
使用showModalBottomSheet。这里有一个例子
onPressed: () {
showModalBottomSheet(
context: context,
builder: (BuildContext ctx) {
return Container(
padding: EdgeInsets.only(top: 20),
child: Container() //add any widget here
);
});
}
对于第一个问题,将您的图像放在AnimatedAlign小部件中,您可以使用此小部件,并使用视差效果:
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("SlidingUpPanelExample"),
),
body: SlidingUpPanel(
parallaxEnabled: true,
panel: Center(
child: Text("This is the sliding Widget"),
),
body: Center(
child: Text("This is the Widget behind the sliding panel"),
),
),
);
}