我有以下代码
Column(
children: [
Container(
width: 200,
height: 300,
decoration: const BoxDecoration(
color: Colors.red,
borderRadius: BorderRadius.all(Radius.circular(15.0)),
),
),
Container(
width: 150,
height: 200,
decoration: const BoxDecoration(
color: Colors.blue,
borderRadius: BorderRadius.all(Radius.circular(15.0)),
),
),
Container(
width: 100,
height: 150,
decoration: const BoxDecoration(
color: Colors.green,
borderRadius:BorderRadius.all(Radius.circular(15.0)),
),
),
],
)
UI
中的输出正常。但我试图使设计像以下
我尝试使用Stack
,但问题是堆栈不适合我的情况,因为项目大小不固定,所以会有问题。在我前面的例子中的height
和width
只是作为例子,但事实上,值取决于列处理此自动的项目内容
1条答案
按热度按时间nqwrtyyt1#
你可以使用Stack与Positioned widget来实现这个ui,下面你可以检查代码.
输出: