0 points

How to decorate text stroke in Flutter


dashboard

Thu Dec 26 2019 18:27:15 GMT+0000 (UTC)

Posted by @sher93oz #dart #flutter #howto

Text("Border test",
    style: TextStyle(
      inherit: true,
      fontSize: 48.0,
      color: Colors.pink,
      shadows: [
        Shadow( // bottomLeft
          offset: Offset(-1.5, -1.5),
          color: Colors.white
        ),
        Shadow( // bottomRight
          offset: Offset(1.5, -1.5),
          color: Colors.white
        ),
        Shadow( // topRight
          offset: Offset(1.5, 1.5),
          color: Colors.white
        ),
        Shadow( // topLeft
          offset: Offset(-1.5, 1.5),
          color: Colors.white
        ),
      ]
    ),
);
content_copy Copy

This is a workaround using 4 shadows in the TextStyle

https://stackoverflow.com/questions/52146269/how-to-decorate-text-stroke-in-flutter