Skip to content

Commit 5377182

Browse files
authored
Fix Align doc (#123566)
Fix Align doc
1 parent 762ff6c commit 5377182

File tree

1 file changed

+19
-14
lines changed

1 file changed

+19
-14
lines changed

packages/flutter/lib/src/widgets/basic.dart

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1982,13 +1982,6 @@ class Padding extends SingleChildRenderObjectWidget {
19821982
/// dimension and the size factor. For example if widthFactor is 2.0 then
19831983
/// the width of this widget will always be twice its child's width.
19841984
///
1985-
/// ## How it works
1986-
///
1987-
/// The [alignment] property describes a point in the `child`'s coordinate system
1988-
/// and a different point in the coordinate system of this widget. The [Align]
1989-
/// widget positions the `child` such that both points are lined up on top of
1990-
/// each other.
1991-
///
19921985
/// {@tool snippet}
19931986
/// The [Align] widget in this example uses one of the defined constants from
19941987
/// [Alignment], [Alignment.topRight]. This places the [FlutterLogo] in the top
@@ -2013,15 +2006,27 @@ class Padding extends SingleChildRenderObjectWidget {
20132006
/// ```
20142007
/// {@end-tool}
20152008
///
2009+
/// ## How it works
2010+
///
2011+
/// The [alignment] property describes a point in the `child`'s coordinate system
2012+
/// and a different point in the coordinate system of this widget. The [Align]
2013+
/// widget positions the `child` such that both points are lined up on top of
2014+
/// each other.
2015+
///
20162016
/// {@tool snippet}
2017-
/// The [Alignment] used in the following example defines a single point:
2017+
/// The [Alignment] used in the following example defines two points:
20182018
///
20192019
/// * (0.2 * width of [FlutterLogo]/2 + width of [FlutterLogo]/2, 0.6 * height
2020-
/// of [FlutterLogo]/2 + height of [FlutterLogo]/2) = (36.0, 48.0).
2020+
/// of [FlutterLogo]/2 + height of [FlutterLogo]/2) = (36.0, 48.0) in the
2021+
/// coordinate system of the [FlutterLogo].
2022+
/// * (0.2 * width of [Align]/2 + width of [Align]/2, 0.6 * height
2023+
/// of [Align]/2 + height of [Align]/2) = (72.0, 96.0) in the
2024+
/// coordinate system of the [Align] widget (blue area).
20212025
///
2022-
/// The [Alignment] class uses a coordinate system with an origin in the center
2023-
/// of the [Container], as shown with the [Icon] above. [Align] will place the
2024-
/// [FlutterLogo] at (36.0, 48.0) according to this coordinate system.
2026+
/// The [Align] widget positions the [FlutterLogo] such that the two points are on
2027+
/// top of each other. In this example, the top left of the [FlutterLogo] will
2028+
/// be placed at (72.0, 96.0) - (36.0, 48.0) = (36.0, 48.0) from the top left of
2029+
/// the [Align] widget.
20252030
///
20262031
/// ![A blue square container with the Flutter logo positioned according to the
20272032
/// Alignment specified above. A point is marked at the center of the container
@@ -2048,9 +2053,9 @@ class Padding extends SingleChildRenderObjectWidget {
20482053
/// The [FractionalOffset] used in the following example defines two points:
20492054
///
20502055
/// * (0.2 * width of [FlutterLogo], 0.6 * height of [FlutterLogo]) = (12.0, 36.0)
2051-
/// in the coordinate system of the blue container.
2056+
/// in the coordinate system of the [FlutterLogo].
20522057
/// * (0.2 * width of [Align], 0.6 * height of [Align]) = (24.0, 72.0) in the
2053-
/// coordinate system of the [Align] widget.
2058+
/// coordinate system of the [Align] widget (blue area).
20542059
///
20552060
/// The [Align] widget positions the [FlutterLogo] such that the two points are on
20562061
/// top of each other. In this example, the top left of the [FlutterLogo] will

0 commit comments

Comments
 (0)