如何在flutter中给出容器的这种类型的阴影?

问题描述 投票:0回答:1

我有一个带有

GridView.builder
crossAxisCount: 3,
的简单屏幕,在
itemBuilder
中,我返回
Container 
,左、右、下都有小阴影。但未能达到我想要的目标。

when i try i achieve this

这是我的代码

GridView.builder(
          padding: EdgeInsets.symmetric(horizontal: 15),
          scrollDirection: Axis.vertical,
          physics: BouncingScrollPhysics(),
          gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
            crossAxisCount: 3,
            crossAxisSpacing: 15,
            mainAxisSpacing: 20,
            childAspectRatio: 2 / 3.3,
          ),
          primary: false,
          shrinkWrap: true,
          itemCount: 100,
          itemBuilder: (context, index) {
            return Container(
              decoration: BoxDecoration(
                  color: Colors.white,
                  borderRadius: BorderRadius.circular(10),
                  boxShadow: [
                    BoxShadow(
                        color: Colors.black12,
                        blurRadius: 5,
                        spreadRadius: 5,
                        offset: Offset(1, 1)),
                  ]),
            );
          },
        ),

this is what i want to achieve

css flutter dart containers shadow
1个回答
0
投票

你能详细解释一下什么愿望吗?我不太明白

© www.soinside.com 2019 - 2024. All rights reserved.