我想为ElevatedButton设置一个渐变作为背景色。
所以我这样做了:
Container(
height: 100,
width: 100,
decoration: const BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topRight,
end: Alignment.bottomLeft,
colors: [
Color(0xFFFE1871),
Color(0xFFFD0E38),
Color(0xFFFF0205),
],
)),
child: ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: Colors.transparent),
onPressed: () {},
child: const Text(
'S\'inscrire',
)),
),
但是渐变的颜色比预期的要深。
我想要的是
这是我的资料
Colors.transparent似乎有一些默认的不透明度。
怎么修?
3条答案
按热度按时间qeeaahzv1#
添加阴影颜色
igetnqfo2#
是shadowColor
它的工作对我来说下面是代码和截图
fzsnzjdm3#
我知道这可能不是最好的解决办法,但你可以试试这个