DecoratedBox class
A widget that paints a Decoration either before or after its child paints.
Container insets its child by the widths of the borders; this widget does not. The child is laid out against the full box and then paint-clipped to the decoration's inner rect, so a child that fills the box is cropped rather than allowed to erase the border.
Commonly used with BoxDecoration.
- Inheritance
-
- Object
- Widget
- RenderObjectWidget
- SingleChildRenderObjectWidget
- DecoratedBox
Constructors
- DecoratedBox({required Decoration decoration, DecorationPosition position = DecorationPosition.background, Widget? child, Key? key})
-
Creates a widget that paints a Decoration.
const
Properties
- child → Widget?
-
Optional widget attached through this render object's single-child edge.
finalinherited
- decoration → Decoration
-
What decoration to paint.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how this widget replaces another of the same type.
finalinherited
- position → DecorationPosition
-
Whether to paint the box decoration behind or in front of the child.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited