简体   繁体   中英

How can I apply box Shadow to container similar to that of an elevated button or Materialize CSS on Flutter?

I have been struggling a lot to achieve this, for all box shadow solutions are just not suitable! Bellow is the result I want to have: 在此处输入图像描述

Just add it like below:

                          Container(
                          decoration: BoxDecoration(
                              borderRadius: BorderRadius.circular(10),
                              image: DecorationImage(
                                image: CachedNetworkImageProvider('your_image'),
                                fit: BoxFit.cover,
                              ),
                              boxShadow: const [
                            BoxShadow(
                              color: Color.fromARGB(255, 0, 0, 0),
                              blurRadius: 2.0,
                              spreadRadius: 0.0,
                              offset: Offset(1, 1), //
                            ),
                          ]));

请将您的容器小部件包装在卡片中并使用卡片的海拔属性。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM