All about Container Widget
Container only have one child. That means Container can only have one widget :
body: Container(
color: Colors.teal,
padding: EdgeInsets.all(20),
child: Container(
margin: EdgeInsets.all(30),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
gradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: <Color>[Colors.amber, Colors.white70])),
),
),-
alignment → AlignmentGeometry Align the child within the container. [...]
-
child → Widget The child contained by the container. [...]
-
constraints → BoxConstraints Additional constraints to apply to the child. [...]
-
decoration → Decoration The decoration to paint behind the child. [...]
-
foregroundDecoration → Decoration The decoration to paint in front of the child.
-
margin → EdgeInsetsGeometry Empty space to surround the decoration and child.
-
padding → EdgeInsetsGeometry Empty space to inscribe inside the decoration. The child, if any, is placed inside this padding. [...]
-
transform → Matrix4 The transformation matrix to apply before painting the container.
-
hashCode → int The hash code for this object. [...]
-
key → Key Controls how one widget replaces another widget in the tree. [...]
-
runtimeType → Type A representation of the runtime type of the object.
You can see the full example from here