扑。容器边界渐变。白色到透明

问题描述 投票:-2回答:1

你知道如何用渐变制作容器边框吗?我想让它从一种颜色淡化到相同的0不透明度。

我也在考虑使用混合模式,我不认为这是一个好主意

在这一刻,我只看到一种方式。使用耀斑:https://www.2dimensions.com/a/stellarcreed/files/flare/border-gradient/preview

dart flutter
1个回答
0
投票

试试这个:

Center(
  child: new Container(
    decoration: new BoxDecoration(
      color: Colors.purple,
      gradient: new LinearGradient(
        colors: [Colors.red, Colors.cyan],
      ),
    ),
    child: new FlutterLogo(
      size: 200.0,
    )
  ),
);

这里有更多信息regarding this question

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