frame method

Widget frame({
  1. double? minWidth,
  2. double? minHeight,
  3. double? width,
  4. double? height,
  5. double? maxWidth,
  6. double? maxHeight,
  7. double? idealWidth,
  8. double? idealHeight,
})

Modifier for setting widget size.

Implementation

Widget frame(
    {double? minWidth,
    double? minHeight,
    double? width,
    double? height,
    double? maxWidth,
    double? maxHeight,
    double? idealWidth,
    double? idealHeight}) {
  return minWidth != null || minHeight != null
      ? ConstrainedBox(
          constraints: BoxConstraints(
              minWidth: minWidth ?? 0.0, minHeight: minHeight ?? 0.0))
      : width != null || height != null
          ? SizedBox(
              width: width,
              height: height,
              child: this
            )
          : maxWidth != null || maxHeight != null
              ? LimitedBox(
                  maxWidth: maxWidth ?? double.infinity,
                  maxHeight: maxHeight ?? double.infinity,
                  child: this,
                )
              : idealWidth != null || idealHeight != null
                  ? PreferredSize(
                      preferredSize: Size(idealWidth ?? double.infinity,
                          idealHeight ?? double.infinity),
                      child: this)
                  : const SizedBox.shrink();
}