size function

Widget size(
  1. Widget widget,
  2. double? height,
  3. double? width
)

Implementation

Widget size(Widget widget, double? height, double? width) {
  if (width != null && height != null) {
    return SizedBox(width: width, height: height, child: widget);
  }
  if (width != null) {
    return SizedBox(width: width, child: widget);
  }
  if (height != null) {
    return SizedBox(height: height, child: widget);
  }
  return widget;
}