mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Document various 'alignment' members so it's clear how to concretely specify it. (#13577)
This commit is contained in:
parent
81e2da9dd9
commit
6299dbada8
@ -108,6 +108,13 @@ class IconButton extends StatelessWidget {
|
||||
/// Defines how the icon is positioned within the IconButton.
|
||||
///
|
||||
/// 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;
|
||||
|
||||
/// The icon to display inside the button.
|
||||
|
||||
@ -86,6 +86,13 @@ class DecorationImage {
|
||||
/// when the image is painted.
|
||||
///
|
||||
/// 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;
|
||||
|
||||
/// The center slice for a nine-patch image.
|
||||
|
||||
@ -166,6 +166,13 @@ class AnimatedCrossFade extends StatefulWidget {
|
||||
/// How the children should be aligned while the size is animating.
|
||||
///
|
||||
/// 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;
|
||||
|
||||
/// A builder that positions the [firstChild] and [secondChild] widgets.
|
||||
|
||||
@ -34,6 +34,15 @@ class AnimatedSize extends SingleChildRenderObjectWidget {
|
||||
/// 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
|
||||
/// 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;
|
||||
|
||||
/// The animation curve when transitioning this widget's size to match the
|
||||
|
||||
@ -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
|
||||
/// 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.
|
||||
///
|
||||
/// 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;
|
||||
|
||||
@override
|
||||
@ -1672,7 +1681,7 @@ class UnconstrainedBox extends SingleChildRenderObjectWidget {
|
||||
/// be retained, and if set to [Axis.horizontal], then horizontal constraints
|
||||
/// will be retained.
|
||||
final Axis constrainedAxis;
|
||||
|
||||
|
||||
@override
|
||||
void updateRenderObject(BuildContext context, covariant RenderUnconstrainedBox renderObject) {
|
||||
renderObject
|
||||
@ -1752,6 +1761,15 @@ class FractionallySizedBox extends SingleChildRenderObjectWidget {
|
||||
/// 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
|
||||
/// 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;
|
||||
|
||||
@override
|
||||
@ -1886,6 +1904,15 @@ class OverflowBox extends SingleChildRenderObjectWidget {
|
||||
/// 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
|
||||
/// 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;
|
||||
|
||||
/// The minimum width constraint to give the child. Set this to null (the
|
||||
@ -1973,6 +2000,15 @@ class SizedOverflowBox extends SingleChildRenderObjectWidget {
|
||||
/// 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
|
||||
/// 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;
|
||||
|
||||
/// The size this widget should attempt to be.
|
||||
@ -2498,6 +2534,15 @@ class Stack extends MultiChildRenderObjectWidget {
|
||||
/// particular axis (e.g. that have neither `top` nor `bottom` set), use the
|
||||
/// alignment to determine how they should be positioned in that
|
||||
/// 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;
|
||||
|
||||
/// The text direction with which to resolve [alignment].
|
||||
@ -4244,6 +4289,13 @@ class RawImage extends LeafRenderObjectWidget {
|
||||
/// must be in scope.
|
||||
///
|
||||
/// 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;
|
||||
|
||||
/// How to paint any portions of the layout bounds not covered by the image.
|
||||
|
||||
@ -279,6 +279,13 @@ class Container extends StatelessWidget {
|
||||
/// constraints are unbounded, then the child will be shrink-wrapped instead.
|
||||
///
|
||||
/// 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;
|
||||
|
||||
/// Empty space to inscribe inside the [decoration]. The [child], if any, is
|
||||
|
||||
@ -251,6 +251,13 @@ class FadeInImage extends StatefulWidget {
|
||||
/// must be in scope.
|
||||
///
|
||||
/// 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;
|
||||
|
||||
/// How to paint any portions of the layout bounds not covered by the image.
|
||||
|
||||
@ -391,6 +391,13 @@ class Image extends StatefulWidget {
|
||||
/// must be in scope.
|
||||
///
|
||||
/// 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;
|
||||
|
||||
/// How to paint any portions of the layout bounds not covered by the image.
|
||||
|
||||
@ -398,6 +398,13 @@ class AnimatedContainer extends ImplicitlyAnimatedWidget {
|
||||
/// constraints are unbounded, then the child will be shrink-wrapped instead.
|
||||
///
|
||||
/// 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;
|
||||
|
||||
/// Empty space to inscribe inside the [decoration]. The [child], if any, is
|
||||
@ -1144,7 +1151,7 @@ class _AnimatedPhysicalModelState extends AnimatedWidgetBaseState<AnimatedPhysic
|
||||
borderRadius: _borderRadius.evaluate(animation),
|
||||
elevation: _elevation.evaluate(animation),
|
||||
color: widget.animateColor ? _color.evaluate(animation) : widget.color,
|
||||
shadowColor: widget.animateShadowColor
|
||||
shadowColor: widget.animateShadowColor
|
||||
? _shadowColor.evaluate(animation)
|
||||
: widget.shadowColor,
|
||||
);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user