Search code examples
androidflutterandroid-studiolinear-gradients

Flutter gradient issues


Flutter gradient issues

When I place a specific color I have problems with the gradient, but when I place a default color, for example Colors.blue, then it is solved, also when I remove opacity from the colors, that's why the two colors below do not have that problem. The problem is that I have to use the colors that the designer gives me.

body: Container(
      // height: double.infinity,
      decoration: BoxDecoration(
          gradient: LinearGradient(
            begin: Alignment.topCenter,
            end: Alignment.bottomCenter,
            stops: [0.0, 0.54, 1.0],

              colors: [
                Color(0xFF00092B),
                Color(0xE0001D5E),
                Color(0xC722004D),
              ],
              // tileMode: TileMode.clamp
          )
      ),
    ),

Solution

  • Your gradient looks fine using DartPad: https://www.dartpad.dev/b6409e10de32b280b8938aa75364fa7b?

    It's probably your emulator screen playing up.