1

Is it possible to draw horizontal strokes around a Text with flutter like the one I show below?

sample image

bensofter
  • 760
  • 1
  • 14
  • 27

2 Answers2

1

You can draw a single line through text with in style in Text widget

   Text('N',style: TextStyle(fontSize:30,decoration: TextDecoration.lineThrough,
                decorationThickness: 2.85,),)

if you want to double strike,but you can create a image of line then show that into a Text Widget you can check the following link or you can use the below answer by savke

custom-strikethrough-to-text

Abhijith
  • 2,227
  • 2
  • 15
  • 39
1

You can do this with Stack widget.

        Stack(
          children: <Widget>[
            Text(
              'N',
            ),
            Positioned(
              top: 8,
              child: Container(
              width: 10,
              height: 2,
              color: Colors.grey
            ),
           ),
            Positioned(
              top: 12,
              child: Container(
              width: 10,
              height: 2,
              color: Colors.grey
            ),
           ),
          ],
        ),

And Stack widget you can put in some Container to limit size of widget.

savke
  • 268
  • 1
  • 3
  • 11