I have a row where the children are 2 Texts. The first is fontsize 20 and the second is size 13. I'm trying to align both to bottom but so far no luck. It's like the first large one gets some additional padding. Any good hints on how to align the two Text?
Asked
Active
Viewed 2,960 times
9
-
Can you upload a picture of your current behavior and the expected one ? – Muldec Dec 13 '18 at 10:12
1 Answers
30
I think you need to play around with the crossAxisAlignment
and textBaseline
properties of your Row
widget.
Try something like this:
Row(
crossAxisAlignment: CrossAxisAlignment.baseline,
textBaseline: TextBaseline.alphabetic,
children: <Widget>[
Text("foo", style: TextStyle(fontSize: 20)),
Text("bar", style: TextStyle(fontSize: 13)),
],
),

Jordan Davies
- 9,925
- 6
- 40
- 51
-
-
Hello Jordan. Care to check my issue here please https://stackoverflow.com/questions/62171872/textbaselines-alphabetic-and-ideographic-enums-do-not-work-in-flutter – user1506104 Jun 08 '20 at 04:14