Unverified Commit 6299dbad authored by xster's avatar xster Committed by GitHub

Document various 'alignment' members so it's clear how to concretely specify it. (#13577)

parent 81e2da9d
...@@ -108,6 +108,13 @@ class IconButton extends StatelessWidget { ...@@ -108,6 +108,13 @@ class IconButton extends StatelessWidget {
/// Defines how the icon is positioned within the IconButton. /// Defines how the icon is positioned within the IconButton.
/// ///
/// This property must not be null. It defaults to [Alignment.center]. /// This property must not be null. It defaults to [Alignment.center].
///
/// See also:
///
/// * [Alignment], a class with convenient constants typically used to
/// specify an [AlignmentGeometry].
/// * [AlignmentDirectional], like [Alignment] for specifying alignments
/// relative to text direction.
final AlignmentGeometry alignment; final AlignmentGeometry alignment;
/// The icon to display inside the button. /// The icon to display inside the button.
......
...@@ -86,6 +86,13 @@ class DecorationImage { ...@@ -86,6 +86,13 @@ class DecorationImage {
/// when the image is painted. /// when the image is painted.
/// ///
/// Defaults to [Alignment.center]. /// Defaults to [Alignment.center].
///
/// See also:
///
/// * [Alignment], a class with convenient constants typically used to
/// specify an [AlignmentGeometry].
/// * [AlignmentDirectional], like [Alignment] for specifying alignments
/// relative to text direction.
final AlignmentGeometry alignment; final AlignmentGeometry alignment;
/// The center slice for a nine-patch image. /// The center slice for a nine-patch image.
......
...@@ -166,6 +166,13 @@ class AnimatedCrossFade extends StatefulWidget { ...@@ -166,6 +166,13 @@ class AnimatedCrossFade extends StatefulWidget {
/// How the children should be aligned while the size is animating. /// How the children should be aligned while the size is animating.
/// ///
/// Defaults to [Alignment.topCenter]. /// Defaults to [Alignment.topCenter].
///
/// See also:
///
/// * [Alignment], a class with convenient constants typically used to
/// specify an [AlignmentGeometry].
/// * [AlignmentDirectional], like [Alignment] for specifying alignments
/// relative to text direction.
final AlignmentGeometry alignment; final AlignmentGeometry alignment;
/// A builder that positions the [firstChild] and [secondChild] widgets. /// A builder that positions the [firstChild] and [secondChild] widgets.
......
...@@ -34,6 +34,15 @@ class AnimatedSize extends SingleChildRenderObjectWidget { ...@@ -34,6 +34,15 @@ class AnimatedSize extends SingleChildRenderObjectWidget {
/// edge of the parent. Other values interpolate (and extrapolate) linearly. /// edge of the parent. Other values interpolate (and extrapolate) linearly.
/// For example, a value of 0.0 means that the center of the child is aligned /// For example, a value of 0.0 means that the center of the child is aligned
/// with the center of the parent. /// with the center of the parent.
///
/// Defaults to [Alignment.center].
///
/// See also:
///
/// * [Alignment], a class with convenient constants typically used to
/// specify an [AlignmentGeometry].
/// * [AlignmentDirectional], like [Alignment] for specifying alignments
/// relative to text direction.
final AlignmentGeometry alignment; final AlignmentGeometry alignment;
/// The animation curve when transitioning this widget's size to match the /// The animation curve when transitioning this widget's size to match the
......
...@@ -1001,6 +1001,15 @@ class FittedBox extends SingleChildRenderObjectWidget { ...@@ -1001,6 +1001,15 @@ class FittedBox extends SingleChildRenderObjectWidget {
/// An alignment of (-1.0, -1.0) aligns the child to the top-left corner of its /// An alignment of (-1.0, -1.0) aligns the child to the top-left corner of its
/// parent's bounds. An alignment of (1.0, 0.0) aligns the child to the middle /// parent's bounds. An alignment of (1.0, 0.0) aligns the child to the middle
/// of the right edge of its parent's bounds. /// of the right edge of its parent's bounds.
///
/// Defaults to [Alignment.center].
///
/// See also:
///
/// * [Alignment], a class with convenient constants typically used to
/// specify an [AlignmentGeometry].
/// * [AlignmentDirectional], like [Alignment] for specifying alignments
/// relative to text direction.
final AlignmentGeometry alignment; final AlignmentGeometry alignment;
@override @override
...@@ -1672,7 +1681,7 @@ class UnconstrainedBox extends SingleChildRenderObjectWidget { ...@@ -1672,7 +1681,7 @@ class UnconstrainedBox extends SingleChildRenderObjectWidget {
/// be retained, and if set to [Axis.horizontal], then horizontal constraints /// be retained, and if set to [Axis.horizontal], then horizontal constraints
/// will be retained. /// will be retained.
final Axis constrainedAxis; final Axis constrainedAxis;
@override @override
void updateRenderObject(BuildContext context, covariant RenderUnconstrainedBox renderObject) { void updateRenderObject(BuildContext context, covariant RenderUnconstrainedBox renderObject) {
renderObject renderObject
...@@ -1752,6 +1761,15 @@ class FractionallySizedBox extends SingleChildRenderObjectWidget { ...@@ -1752,6 +1761,15 @@ class FractionallySizedBox extends SingleChildRenderObjectWidget {
/// edge of the parent. Other values interpolate (and extrapolate) linearly. /// edge of the parent. Other values interpolate (and extrapolate) linearly.
/// For example, a value of 0.0 means that the center of the child is aligned /// For example, a value of 0.0 means that the center of the child is aligned
/// with the center of the parent. /// with the center of the parent.
///
/// Defaults to [Alignment.center].
///
/// See also:
///
/// * [Alignment], a class with convenient constants typically used to
/// specify an [AlignmentGeometry].
/// * [AlignmentDirectional], like [Alignment] for specifying alignments
/// relative to text direction.
final AlignmentGeometry alignment; final AlignmentGeometry alignment;
@override @override
...@@ -1886,6 +1904,15 @@ class OverflowBox extends SingleChildRenderObjectWidget { ...@@ -1886,6 +1904,15 @@ class OverflowBox extends SingleChildRenderObjectWidget {
/// edge of the parent. Other values interpolate (and extrapolate) linearly. /// edge of the parent. Other values interpolate (and extrapolate) linearly.
/// For example, a value of 0.0 means that the center of the child is aligned /// For example, a value of 0.0 means that the center of the child is aligned
/// with the center of the parent. /// with the center of the parent.
///
/// Defaults to [Alignment.center].
///
/// See also:
///
/// * [Alignment], a class with convenient constants typically used to
/// specify an [AlignmentGeometry].
/// * [AlignmentDirectional], like [Alignment] for specifying alignments
/// relative to text direction.
final AlignmentGeometry alignment; final AlignmentGeometry alignment;
/// The minimum width constraint to give the child. Set this to null (the /// The minimum width constraint to give the child. Set this to null (the
...@@ -1973,6 +2000,15 @@ class SizedOverflowBox extends SingleChildRenderObjectWidget { ...@@ -1973,6 +2000,15 @@ class SizedOverflowBox extends SingleChildRenderObjectWidget {
/// edge of the parent. Other values interpolate (and extrapolate) linearly. /// edge of the parent. Other values interpolate (and extrapolate) linearly.
/// For example, a value of 0.0 means that the center of the child is aligned /// For example, a value of 0.0 means that the center of the child is aligned
/// with the center of the parent. /// with the center of the parent.
///
/// Defaults to [Alignment.center].
///
/// See also:
///
/// * [Alignment], a class with convenient constants typically used to
/// specify an [AlignmentGeometry].
/// * [AlignmentDirectional], like [Alignment] for specifying alignments
/// relative to text direction.
final AlignmentGeometry alignment; final AlignmentGeometry alignment;
/// The size this widget should attempt to be. /// The size this widget should attempt to be.
...@@ -2498,6 +2534,15 @@ class Stack extends MultiChildRenderObjectWidget { ...@@ -2498,6 +2534,15 @@ class Stack extends MultiChildRenderObjectWidget {
/// particular axis (e.g. that have neither `top` nor `bottom` set), use the /// particular axis (e.g. that have neither `top` nor `bottom` set), use the
/// alignment to determine how they should be positioned in that /// alignment to determine how they should be positioned in that
/// under-specified axis. /// under-specified axis.
///
/// Defaults to [AlignmentDirectional.topStart].
///
/// See also:
///
/// * [Alignment], a class with convenient constants typically used to
/// specify an [AlignmentGeometry].
/// * [AlignmentDirectional], like [Alignment] for specifying alignments
/// relative to text direction.
final AlignmentGeometry alignment; final AlignmentGeometry alignment;
/// The text direction with which to resolve [alignment]. /// The text direction with which to resolve [alignment].
...@@ -4244,6 +4289,13 @@ class RawImage extends LeafRenderObjectWidget { ...@@ -4244,6 +4289,13 @@ class RawImage extends LeafRenderObjectWidget {
/// must be in scope. /// must be in scope.
/// ///
/// Defaults to [Alignment.center]. /// Defaults to [Alignment.center].
///
/// See also:
///
/// * [Alignment], a class with convenient constants typically used to
/// specify an [AlignmentGeometry].
/// * [AlignmentDirectional], like [Alignment] for specifying alignments
/// relative to text direction.
final AlignmentGeometry alignment; final AlignmentGeometry alignment;
/// How to paint any portions of the layout bounds not covered by the image. /// How to paint any portions of the layout bounds not covered by the image.
......
...@@ -279,6 +279,13 @@ class Container extends StatelessWidget { ...@@ -279,6 +279,13 @@ class Container extends StatelessWidget {
/// constraints are unbounded, then the child will be shrink-wrapped instead. /// constraints are unbounded, then the child will be shrink-wrapped instead.
/// ///
/// Ignored if [child] is null. /// Ignored if [child] is null.
///
/// See also:
///
/// * [Alignment], a class with convenient constants typically used to
/// specify an [AlignmentGeometry].
/// * [AlignmentDirectional], like [Alignment] for specifying alignments
/// relative to text direction.
final AlignmentGeometry alignment; final AlignmentGeometry alignment;
/// Empty space to inscribe inside the [decoration]. The [child], if any, is /// Empty space to inscribe inside the [decoration]. The [child], if any, is
......
...@@ -251,6 +251,13 @@ class FadeInImage extends StatefulWidget { ...@@ -251,6 +251,13 @@ class FadeInImage extends StatefulWidget {
/// must be in scope. /// must be in scope.
/// ///
/// Defaults to [Alignment.center]. /// Defaults to [Alignment.center].
///
/// See also:
///
/// * [Alignment], a class with convenient constants typically used to
/// specify an [AlignmentGeometry].
/// * [AlignmentDirectional], like [Alignment] for specifying alignments
/// relative to text direction.
final AlignmentGeometry alignment; final AlignmentGeometry alignment;
/// How to paint any portions of the layout bounds not covered by the image. /// How to paint any portions of the layout bounds not covered by the image.
......
...@@ -391,6 +391,13 @@ class Image extends StatefulWidget { ...@@ -391,6 +391,13 @@ class Image extends StatefulWidget {
/// must be in scope. /// must be in scope.
/// ///
/// Defaults to [Alignment.center]. /// Defaults to [Alignment.center].
///
/// See also:
///
/// * [Alignment], a class with convenient constants typically used to
/// specify an [AlignmentGeometry].
/// * [AlignmentDirectional], like [Alignment] for specifying alignments
/// relative to text direction.
final AlignmentGeometry alignment; final AlignmentGeometry alignment;
/// How to paint any portions of the layout bounds not covered by the image. /// How to paint any portions of the layout bounds not covered by the image.
......
...@@ -398,6 +398,13 @@ class AnimatedContainer extends ImplicitlyAnimatedWidget { ...@@ -398,6 +398,13 @@ class AnimatedContainer extends ImplicitlyAnimatedWidget {
/// constraints are unbounded, then the child will be shrink-wrapped instead. /// constraints are unbounded, then the child will be shrink-wrapped instead.
/// ///
/// Ignored if [child] is null. /// Ignored if [child] is null.
///
/// See also:
///
/// * [Alignment], a class with convenient constants typically used to
/// specify an [AlignmentGeometry].
/// * [AlignmentDirectional], like [Alignment] for specifying alignments
/// relative to text direction.
final AlignmentGeometry alignment; final AlignmentGeometry alignment;
/// Empty space to inscribe inside the [decoration]. The [child], if any, is /// Empty space to inscribe inside the [decoration]. The [child], if any, is
...@@ -1144,7 +1151,7 @@ class _AnimatedPhysicalModelState extends AnimatedWidgetBaseState<AnimatedPhysic ...@@ -1144,7 +1151,7 @@ class _AnimatedPhysicalModelState extends AnimatedWidgetBaseState<AnimatedPhysic
borderRadius: _borderRadius.evaluate(animation), borderRadius: _borderRadius.evaluate(animation),
elevation: _elevation.evaluate(animation), elevation: _elevation.evaluate(animation),
color: widget.animateColor ? _color.evaluate(animation) : widget.color, color: widget.animateColor ? _color.evaluate(animation) : widget.color,
shadowColor: widget.animateShadowColor shadowColor: widget.animateShadowColor
? _shadowColor.evaluate(animation) ? _shadowColor.evaluate(animation)
: widget.shadowColor, : widget.shadowColor,
); );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment