flutter 我想知道如何制作这些容器

sy5wg1nm  于 2023-05-23  发布在  Flutter
关注(0)|答案(1)|浏览(125)

我想知道如何制作这些容器。
集装箱现在代码

Container(
                    width: screenWidth / 1.1,
                    height: screenHeight / 6,
                    decoration: BoxDecoration(
                        color: Color.fromRGBO(255, 255, 255, 0.1),
                        shape: BoxShape.rectangle,
                        borderRadius: BorderRadius.all(Radius.circular(15))),
)

背绿色

#0E8375
tpxzln5u

tpxzln5u1#

glassmorphism软件包添加到pubspec.yaml文件中并尝试此操作。

GlassmorphicContainer(
                            width: 400,
                            height: 200,
                            borderRadius: 20,
                            blur: 10,
                            alignment: Alignment.bottomCenter,
                            linearGradient: LinearGradient(
                              begin: Alignment.topLeft,
                              end: Alignment.bottomRight,
                              colors: [
                                const Color(0xFFffffff).withOpacity(0.3),
                                const Color(0xFFFFFFFF).withOpacity(0.10),
                              ],
                              stops: const [
                                0.1,
                                1,
                              ],
                            ),
                            borderGradient: LinearGradient(
                              begin: Alignment.topLeft,
                              end: Alignment.bottomRight,
                              colors: [
                                const Color(0xFFffffff).withOpacity(0.3),
                                const Color((0xFFFFFFFF)).withOpacity(0.05),
                              ],
                            ),
                            border: 0,
                            child: Padding(
                              padding: const EdgeInsets.only(left: 20, right: 20),
                             
                            ),
                          ),

相关问题