Container class

A convenience widget that combines common painting, positioning, and sizing.

Supports color background, width/height constraints, padding, margin, and box-drawing border characters.

Inheritance

Constructors

Container({Key? key, Widget? child, Color? color, int? width, int? height, EdgeInsets? padding, EdgeInsets? margin, Border? border})
Creates a Container with optional styling and a single child.
const

Properties

border Border?
The box-drawing border characters to draw around the container.
final
child Widget?
The optional child widget.
finalinherited
color Color?
The background color of the container.
final
hashCode int
The hash code for this object.
no setterinherited
height int?
The fixed height of the container, or null to size from the child.
final
key Key?
Controls how one widget replaces another in the tree.
finalinherited
margin EdgeInsets?
Outer margin around the container.
final
padding EdgeInsets?
Inner padding between the border and the child.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
width int?
The fixed width of the container, or null to size from the child.
final

Methods

createElement() SingleChildRenderObjectElement
Creates the Element for this widget.
inherited
createRenderObject(BuildContext context) RenderContainer
Creates the RenderObject for this widget.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
updateRenderObject(BuildContext context, RenderObject renderObject) → void
Updates the renderObject to reflect the current widget configuration.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited