2

The code below makes a radial gradient. However the gradient has no smooth transitioning from one color to the other. It has blocked transition like this

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

Is there a way to make the gradient smooth?

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,
         )
       ),
Zoe
  • 27,060
  • 21
  • 118
  • 148
Moon Star
  • 23
  • 6
  • use GradientDrawable like this -https://stackoverflow.com/questions/6115715/how-do-i-programmatically-set-the-background-color-gradient-on-a-custom-title-ba – Adil May 29 '18 at 09:58
  • https://android--code.blogspot.in/2015/01/android-button-gradient-color.html – Adil May 29 '18 at 09:59

1 Answers1

0

remove the "stops" property to have a smooth transition!