szdbox method

Widget szdbox({
  1. double? h,
  2. double? w,
  3. Color? col,
})

Returns: A custom widget named szdbox is being returned. This widget either returns a Container with the specified color, height, width, and child widget if the color is not null, or returns a SizedBox with the specified height, width, and child widget if the color is null.

Implementation

Widget szdbox({double? h, double? w, Color? col}) {
  return col != null
      ? Container(color: col, height: h, width: w, child: this)
      : SizedBox(height: h, width: w, child: this);
}