GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing api.flutter.dev — Container class - widgets library - Dart API Container classA convenience widget that combines common painting, positioning, and sizing widgets. A container first surrounds the child with padding (inflated by any
borders present in the decoration) and then applies additional
constraints to the padded extent (incorporating the During painting, the container first applies the given transform, then paints the decoration to fill the padded extent, then it paints the child, and finally paints the foregroundDecoration, also filling the padded extent. Containers with no children try to be as big as possible unless the incoming
constraints are unbounded, in which case they try to be as small as
possible. Containers with children size themselves to their children. The
By default, containers return false for all hit tests. If the color property is specified, the hit testing is handled by ColoredBox, which always returns true. If the decoration or foregroundDecoration properties are specified, hit testing is handled by Decoration.hitTest. Layout behaviorSee 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 More specifically: If the widget has no child, no If the widget has no child and no alignment, but a If the widget has no child, no 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 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. Example
This example shows a 48x48 amber square (placed inside a Center widget in
case the parent widget has its own opinions regarding the size that the
Container should take), with a margin so that it stays away from
neighboring widgets:
link
This example shows how to use many of the features of Container at once.
The constraints are set to fit the font size plus ample headroom
vertically, while expanding horizontally to fit the parent. The padding is
used to make sure there is space between the contents and the text. The
color makes the box blue. The alignment causes the child to be
centered in the box. Finally, the transform applies a slight rotation to the
entire contraption to complete the effect.
link
See also:
Constructors
Properties
Methods
Operators
|
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |