Home > Back-end >  How to give shadow to Text in Flutter?
How to give shadow to Text in Flutter?

Time:11-29

I want give shadow to particular text.

CodePudding user response:

Text(
  'Hello Flutter',
  style: TextStyle(
    shadows: <Shadow>[
      Shadow(
        offset: Offset(1.1, 1.1),
        blurRadius: 1,
        color: Color.fromARGB(220, 0, 0, 0),
      ),
      Shadow(
        offset: Offset(1.1, 1.1),
        blurRadius: 1,
        color: Color.fromARGB(110, 0, 0, 210),
      ),
    ],
  ),
),

CodePudding user response:

Try this code:

Text(
  'Hello Flutter',
  style: TextStyle(
    shadows: <Shadow>[
      Shadow(
        offset: Offset(10.0, 10.0),
        blurRadius: 3.0,
        color: Color.fromARGB(255, 0, 0, 0),
      ),
      Shadow(
        offset: Offset(10.0, 10.0),
        blurRadius: 8.0,
        color: Color.fromARGB(125, 0, 0, 255),
      ),
    ],
  ),
),
  • Related