Container constructor

const Container({
  1. Key? key,
  2. Widget? child,
  3. Color? color,
  4. int? width,
  5. int? height,
  6. EdgeInsets? padding,
  7. EdgeInsets? margin,
  8. Border? border,
})

Creates a Container with optional styling and a single child.

Implementation

const Container({
  super.key,
  Widget? child,
  this.color,
  this.width,
  this.height,
  this.padding,
  this.margin,
  this.border,
}) : super(child: child ?? const SizedBox());