Flutter-LinearGradient的平滑过渡颜色 [英] Flutter - Smooth transition color for LinearGradient
问题描述
喂!
是否存在创建在起始色和ens颜色之间具有平滑过渡的LinearGradient的解决方案?
Is there a solution for creating a LinearGradient that has a smooth transition between start and ens color?
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
)
),
)
推荐答案
似乎来自Android仿真器.在这种情况下,它将使用低质量的渲染器,以使其足够快地运行,尤其是在功能较弱的硬件上.在真实的设备上进行测试,您可能会看到更好的结果.我相信您也许还可以提高模拟器上的图形,但不能百分百确定这是否可以改善此问题.请参见此处.
It appears as though that may be from the Android Emulator. If that is the case, it uses a low-quality renderer so that it runs fast enough especially on less powerful hardware. Test it out on a real device and you'll likely see better results. I believe you may also be able to bump up the graphics on the emulator but not 100% sure if that would improve this. See here.
这就是Nexus 4与仿真器之间的渐变效果.
This is what the gradient looks like on a Nexus 4 vs the emulator.
这篇关于Flutter-LinearGradient的平滑过渡颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!