mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
Fix doc for DecoratedBox (#59791)
This commit is contained in:
parent
6db22118ad
commit
32be39bf16
@ -46,50 +46,6 @@ import 'image.dart';
|
||||
/// ```
|
||||
/// {@end-tool}
|
||||
///
|
||||
/// ## Layout behavior
|
||||
///
|
||||
/// _See [BoxConstraints] for an introduction to box layout models._
|
||||
///
|
||||
/// Since [Container] combines a number of other widgets each with their own
|
||||
/// layout behavior, [Container]'s layout behavior is somewhat complicated.
|
||||
///
|
||||
/// Summary: [Container] tries, in order: to honor [alignment], to size itself to
|
||||
/// the [child], to honor the `width`, `height`, and [constraints], to expand to
|
||||
/// fit the parent, to be as small as possible.
|
||||
///
|
||||
/// More specifically:
|
||||
///
|
||||
/// If the widget has no child, no `height`, no `width`, no [constraints],
|
||||
/// and the parent provides unbounded constraints, then [Container] tries to
|
||||
/// size as small as possible.
|
||||
///
|
||||
/// If the widget has no child and no [alignment], but a `height`, `width`, or
|
||||
/// [constraints] are provided, then the [Container] tries to be as small as
|
||||
/// possible given the combination of those constraints and the parent's
|
||||
/// constraints.
|
||||
///
|
||||
/// If the widget has no child, no `height`, no `width`, no [constraints], and
|
||||
/// no [alignment], but the parent provides bounded constraints, then
|
||||
/// [Container] expands to fit the constraints provided by the parent.
|
||||
///
|
||||
/// If the widget has an [alignment], and the parent provides unbounded
|
||||
/// constraints, then the [Container] tries to size itself around the child.
|
||||
///
|
||||
/// If the widget has an [alignment], and the parent provides bounded
|
||||
/// constraints, then the [Container] tries to expand to fit the parent, and
|
||||
/// then positions the child within itself as per the [alignment].
|
||||
///
|
||||
/// Otherwise, the widget has a [child] but no `height`, no `width`, no
|
||||
/// [constraints], and no [alignment], and the [Container] passes the
|
||||
/// constraints from the parent to the child and sizes itself to match the
|
||||
/// child.
|
||||
///
|
||||
/// The [margin] and [padding] properties also affect the layout, as described
|
||||
/// in the documentation for those properties. (Their effects merely augment the
|
||||
/// rules described above.) The [decoration] can implicitly increase the
|
||||
/// [padding] (e.g. borders in a [BoxDecoration] contribute to the [padding]);
|
||||
/// see [Decoration.padding].
|
||||
///
|
||||
/// See also:
|
||||
///
|
||||
/// * [Ink], which paints a [Decoration] on a [Material], allowing
|
||||
|
Loading…
Reference in New Issue
Block a user