Box constructor

Box({
  1. double paddingX = 16,
  2. double paddingY = 16,
  3. double radius = 8,
  4. double stroke = 0,
  5. Color strokeColor = Colors.transparent,
  6. double maxHeight = double.infinity,
  7. double maxWidth = double.infinity,
  8. double minHeight = 0,
  9. double minWidth = 0,
  10. double? height,
  11. double? width,
  12. Key? key,
  13. Color? color = Colors.transparent,
  14. double? elevation = 0,
  15. required Widget child,
})

Implementation

Box({
  double paddingX = 16,
  double paddingY = 16,
  double radius = 8,
  double stroke = 0,
  Color strokeColor = Colors.transparent,
  double maxHeight = double.infinity,
  double maxWidth = double.infinity,
  double minHeight = 0,
  double minWidth = 0,
  double? height,
  double? width,
  super.key,
  super.color = Colors.transparent,
  super.elevation = 0,
  required Widget child,
}) : super(
          margin: EdgeInsets.zero,
          shape: RoundedRectangleBorder(
              borderRadius: BorderRadius.circular(radius), side: BorderSide(width: stroke, color: strokeColor)),
          child: Container(
              height: height,
              width: width,
              padding: EdgeInsets.symmetric(horizontal: paddingX, vertical: paddingY),
              constraints:
                  BoxConstraints(minHeight: minHeight, maxHeight: maxHeight, maxWidth: maxWidth, minWidth: minWidth),
              child: child));