ContainerResponsive constructor

ContainerResponsive({
  1. Key? key,
  2. AlignmentGeometry? alignment,
  3. EdgeInsetsGeometry? padding,
  4. Color? color,
  5. Decoration? decoration,
  6. Decoration? foregroundDecoration,
  7. double? width,
  8. double? height,
  9. bool widthResponsive = true,
  10. bool heightResponsive = true,
  11. BoxConstraints? constraints,
  12. EdgeInsetsGeometry? margin,
  13. Matrix4? transform,
  14. Widget? child,
})

Creates a widget that combines common painting, positioning, and sizing widgets.

The height and width values include the padding.

The color argument is a shorthand for decoration: new BoxDecoration(color: color), which means you cannot supply both a color and a decoration argument. If you want to have both a color and a decoration, you can pass the color as the color argument to the BoxDecoration.

Implementation

ContainerResponsive({
  Key? key,
  AlignmentGeometry? alignment,
  EdgeInsetsGeometry? padding,
  Color? color,
  Decoration? decoration,
  Decoration? foregroundDecoration,
  double? width,
  double? height,
  bool widthResponsive = true,
  bool heightResponsive = true,
  BoxConstraints? constraints,
  EdgeInsetsGeometry? margin,
  Matrix4? transform,
  Widget? child,
}) : super(
          key: key,
          alignment: alignment,
          padding: padding,
          color: color,
          decoration: decoration,
          foregroundDecoration: foregroundDecoration,
          width: width,
          height: height,
          constraints: (width != null || height != null)
              ? constraints?.tighten(
                      width: width != null && widthResponsive
                          ? width.w.toDouble()
                          : width,
                      height: height != null && heightResponsive
                          ? height.h.toDouble()
                          : height) ??
                  BoxConstraints.tightFor(
                      width: width != null && widthResponsive
                          ? width.w.toDouble()
                          : width,
                      height: height != null && heightResponsive
                          ? height.h.toDouble()
                          : height)
              : constraints,
          margin: margin,
          transform: transform,
          child: child);