dContainer method

Widget dContainer({
  1. AlignmentGeometry? alignment,
  2. EdgeInsetsGeometry? padding,
  3. Color? color,
  4. Decoration? decoration,
  5. Decoration? foregroundDecoration,
  6. double? width,
  7. double? height,
  8. BoxConstraints? constraints,
  9. EdgeInsetsGeometry? margin,
  10. Matrix4? transform,
  11. AlignmentGeometry? transformAlignment,
  12. Widget? child,
  13. Clip clipBehavior = Clip.none,
})

Creates a Container widget with dynamic dimensions and other customizable properties.

The dContainer method creates a Container widget with dynamic dimensions based on the provided width and height values. Other properties like alignment, padding, color, decoration, margin, transform, etc., can also be customized.

  • alignment: The alignment of the child within the container. (Optional)

  • padding: The padding applied to the container's content. (Optional)

  • color: The background color of the container. (Optional)

  • decoration: The decoration applied to the container. (Optional)

  • foregroundDecoration: The decoration applied to the container's foreground. (Optional)

  • width: The dynamic width value for the container. (Optional)

  • height: The dynamic height value for the container. (Optional)

  • constraints: The additional constraints applied to the container. (Optional)

  • margin: The margin applied around the container. (Optional)

  • transform: The transformation matrix applied to the container. (Optional)

  • transformAlignment: The alignment of the transform within the container. (Optional)

  • child: The child widget placed inside the container. (Optional)

  • clipBehavior: The clipping behavior applied to the container. (Default: Clip.none)

  • Returns: A Container widget with dynamic dimensions and customizable properties.

Implementation

Widget dContainer({
  AlignmentGeometry? alignment,
  EdgeInsetsGeometry? padding,
  Color? color,
  Decoration? decoration,
  Decoration? foregroundDecoration,
  double? width,
  double? height,
  BoxConstraints? constraints,
  EdgeInsetsGeometry? margin,
  Matrix4? transform,
  AlignmentGeometry? transformAlignment,
  Widget? child,
  Clip clipBehavior = Clip.none,
}) {
  return Container(
    decoration: decoration,
    color: color,
    alignment: alignment,
    margin: margin,
    padding: padding,
    clipBehavior: clipBehavior,
    constraints: constraints,
    foregroundDecoration: foregroundDecoration,
    transform: transform,
    transformAlignment: transformAlignment,
    height: height != null ? h(height) : height,
    width: width != null ? w(width) : width,
    child: child,
  );
}