【发布时间】:2021-05-05 11:52:44
【问题描述】:
我是 Flutter 的新手,我想知道如何在我的项目中实现这种设计。
- 如何转换/平移背景以使其从视图中升起和升起?
- 如何在几毫秒后在背景顶部添加另一个容器(位于屏幕底部)?
【问题讨论】:
标签: flutter flutter-layout flutter-animation
我是 Flutter 的新手,我想知道如何在我的项目中实现这种设计。
【问题讨论】:
标签: flutter flutter-layout flutter-animation
使用 showModalBottomSheet。这是一个例子
onPressed: () {
showModalBottomSheet(
context: context,
builder: (BuildContext ctx) {
return Container(
padding: EdgeInsets.only(top: 20),
child: Container() //add any widget here
);
});
}
对于第一个问题,将您的图像放入 AnimatedAlign 小部件中
【讨论】:
你可以用这个,sliding_up_panel 有视差效果:
@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"),
),
),
);
}
【讨论】: