How to remove the gap above and below the text on flutter
1,768
Solution 1
The only way I could find so far is to reduce height
property, the problem though is that it reduces the gap above only. So in your case, you could try to set it for hello
text to the minimum:
Text(
'123',
style: TextStyle(fontSize: 60.0),
),
Text(
'hello',
style: TextStyle(fontSize: 10.0, height: 0.1),
),
Solution 2
Use Stack
widget to align your text widgets
Stack(
children: <Widget>[
Text(
'123',
style: TextStyle(fontSize: 60.0),
),
Positioned(
child: Text('Hello'),
bottom: 0.0,
left: 35.0,
)
],
),
Hope it helps!
Author by