Flutter SDK没有平滑渐变?

时间:2018-05-29 09:47:34

标签: android dart gradient flutter

下面的代码生成径向渐变。然而,梯度没有从一种颜色到另一种颜色的平滑过渡。它阻止了像这样的过渡

http://www.color-hex.com/palettes/7133.png

有没有办法让渐变变得平滑?

Color gradient_start = const Color (0xDD222222);
Color gradient_end = const Color (0xDD444444);

//some code

    new Container(
       decoration: new BoxDecoration(
         gradient:

         new  RadialGradient(
             colors: [gradient_start, gradient_end],
            radius: 1.0,
           stops: [
             0.0,
             0.5,
           ],

           tileMode: TileMode.clamp,
         )
       ),

1 个答案:

答案 0 :(得分:0)

删除“stops”属性以获得平滑过渡!