flutter - Flutter 如何创建 3 层堆栈
问题描述
我需要显示 3 个容器,但要显示一列,但需要显示它们重叠
像这样
正如您在图像中看到的,我需要显示 3 个小部件图像,然后这会创建一个新的帐户标题,而不是另一个容器。
我的代码只是显示一个图像和我需要知道的最后一个容器如何添加这个中间容器,就像在图像中一样
Stack(
children: <Widget>[
Container(
padding: EdgeInsets.only(top: statusBarHeight * 0.8),
height: height * 0.4,
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage(
'assets/images/place2.jpg',
),
fit: BoxFit.fill,
),
),
),
SingleChildScrollView(
child: Padding(
padding: EdgeInsets.only(top: height * 0.3),
child: SingleChildScrollView(
child: ClipRRect(
borderRadius: BorderRadius.only(
topRight: Radius.circular(30), topLeft: Radius.circular(30)),
child: Container(
decoration: BoxDecoration(
color: Colors.white,
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
SizedBox(
height: height * 0.031,
),
Container(
width: width,
margin: EdgeInsets.only(left: 10),
child: Text(
'PLACES',
textAlign: TextAlign.left,
style: TextStyle(fontSize: 30),
),
),
SizedBox(
height: height * 0.02,
),
],
),
),
),
),
),
),
GestureDetector(
onTap: () {
print('back');
},
child: Align(
alignment: Alignment.topLeft,
child: Container(
margin: EdgeInsets.only(left: width * 0.03),
padding: EdgeInsets.only(top: statusBarHeight * 2),
child: Icon(
Icons.arrow_back_ios,
size: 25,
color: Colors.white,
),
),
),
),
],
)
解决方案
推荐阅读
- c++ - 如何将我的 const char 指针更改为唯一指针?
- mysql - 执行一个查询时出现错误语法
- html - 子div的边框长度与父div的宽度相同吗?
- bash - centos 和 debian 中的 /etc/init.d/functions 和 action
- ios - iOS:将 CMSampleBuffer 转换为 UIImage 以错误的方向和比例返回图像
- django - 单个帖子类别的重定向错误
- compiler-construction - 野牛文件中的 main() 函数未运行
- css - 从不同来源多次导入相同的字体有害吗?
- angular - Angular 5过滤管
- apache-spark - 如何解释 Spark 中precisionByThreshold 的返回结果?