gpt4 book ai didi

Flutter - LinearGradient 的平滑过渡颜色

转载 作者:IT王子 更新时间:2023-10-29 06:44:25 30 4
gpt4 key购买 nike

你好!

是否有创建在起始颜色和最终颜色之间平滑过渡的 LinearGradient 的解决方案?

new Container(
decoration: new BoxDecoration(
gradient: new LinearGradient(
colors: [
Colors.black,
Colors.grey,
],
stops: [0.0, 1.0],
begin: FractionalOffset.topCenter,
end: FractionalOffset.bottomCenter,
tileMode: TileMode.repeated
)
),
)

Image showing gradient with poor color resolution

最佳答案

在您的主函数中设置 Paint.enableDithering = true; 如下所示:

void main() {
Paint.enableDithering = true;
runApp(DesignChallenge05());
}

关于Flutter - LinearGradient 的平滑过渡颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49543988/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com