in flutter i am getting error while using crossAxisAlignment: CrossAxisAlignment.baseline
Error::
Failed assertion: line 3791 pos 15: 'crossAxisAlignment != CrossAxisAlignment.baseline || textBaseline != null': is not true.
code::
Row(
crossAxisAlignment: CrossAxisAlignment.baseline,
children: <Widget>[
Text(
'192',
style: kBoldNumberText,
),
Text(
'cm',
style: kLabelText,
)
],
)
The crossAxisAlignment property determines how Row and Column can position their children on their cross axes. A Row 's cross axis is vertical, and a Column 's cross axis is horizontal. The crossAxisAlignment property has five possible values: CrossAxisAlignment.
The horizontal line used to align the bottom of glyphs for alphabetic characters.
While using crossAxisAlignment
in flutter we need to tell what element to align, for that we can use textBaseline: TextBaseline.alphabetic
in alphabetic or if it is graphical
//alphabetic:::
textBaseline: TextBaseline.alphabetic,
-or-
//graphic:::
textBaseline: TextBaseline.ideographic
in my case its alphabetic:::
so i re-write
Row(
crossAxisAlignment: CrossAxisAlignment.baseline,
textBaseline: TextBaseline.alphabetic, ////<-- HERE --> ////
children: <Widget>[
Text(
'192',
style: kBoldNumberText,
),
Text(
'cm',
style: kLabelText,
)
],
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With