@@ -142,6 +142,8 @@ enum MainAxisAlignment {
142
142
/// See also:
143
143
///
144
144
/// * [Column] , [Row] , and [Flex] , the flex widgets.
145
+ /// * [Flex.crossAxisAlignment] , the property on flex widgets that
146
+ /// has this type.
145
147
/// * [RenderFlex] , the flex render object.
146
148
enum CrossAxisAlignment {
147
149
/// Place the children with their start edge aligned with the start side of
@@ -185,16 +187,35 @@ enum CrossAxisAlignment {
185
187
186
188
/// Place the children along the cross axis such that their baselines match.
187
189
///
190
+ /// Consider using this value for any horizontal main axis (as with [Row] )
191
+ /// where the children primarily contain text. If the different children
192
+ /// have text with different font metrics (for example because they differ
193
+ /// in [TextStyle.fontSize] or other [TextStyle] properties, or because
194
+ /// they use different fonts due to being written in different scripts),
195
+ /// then this typically produces better visual alignment than the other
196
+ /// [CrossAxisAlignment] values, which use no information about
197
+ /// where the text sits vertically within its bounding box.
198
+ ///
199
+ /// The baseline of a widget is typically the typographic baseline of the
200
+ /// first text in the first [Text] or [RichText] widget it encloses, if any.
201
+ /// The typographic baseline is a horizontal line used for aligning text,
202
+ /// which is specified by each font; for alphabetic scripts, it ordinarily
203
+ /// runs along the bottom of letters excluding any descenders.
204
+ ///
188
205
/// Because baselines are always horizontal, this alignment is intended for
189
- /// horizontal main axes. If the main axis is vertical, then this value is
190
- /// treated like [start] .
206
+ /// horizontal main axes (as with [Row] ) . If the main axis is vertical
207
+ /// (as with [Column] ), then this value is treated like [start] .
191
208
///
192
209
/// For horizontal main axes, if the minimum height constraint passed to the
193
210
/// flex layout exceeds the intrinsic height of the cross axis, children will
194
211
/// be aligned as close to the top as they can be while honoring the baseline
195
212
/// alignment. In other words, the extra space will be below all the children.
196
213
///
197
214
/// Children who report no baseline will be top-aligned.
215
+ ///
216
+ /// See also:
217
+ ///
218
+ /// * [RenderBox.getDistanceToBaseline] , which defines the baseline of a box.
198
219
baseline,
199
220
}
200
221
0 commit comments