How to add a neon glow effect to an widget border / shadow?

后端 未结 2 1578
無奈伤痛
無奈伤痛 2021-01-13 05:51

Is there any way to create effects like these using flutter (a CustomPaint with a special shadder or something like this)?

2条回答
  •  说谎
    说谎 (楼主)
    2021-01-13 06:25

    You can use BoxShadow widget.. You can set color, blurRadius, SpreadRadius and offset to achieve what you want..

    Note in example I have used it to get a drop shadow.. But you can get a glow if you set the properties correctly..

     Container(
                decoration: BoxDecoration(
                    borderRadius: BorderRadius.circular(50),
                    boxShadow: [
                      BoxShadow(
                        color: Color(0xFF000000).withAlpha(60),
                        blurRadius: 6.0,
                        spreadRadius: 0.0,
                        offset: Offset(
                          0.0,
                          3.0,
                        ),
                      ),
                    ]),
    

提交回复
热议问题