sized method

SizedBox sized({
  1. Size? size,
  2. double? height,
  3. double? width,
})

尺寸控件 >>> 设置固定尺寸

@param size 通过Size对象设置尺寸(可选) @param height 直接设置高度(可选) @param width 直接设置宽度(可选) @return 返回固定尺寸的SizedBox组件

Implementation

SizedBox sized({Size? size, double? height, double? width}) {
  return SizedBox(
    width: width ?? size?.width ?? double.infinity,
    height: height ?? size?.height ?? double.infinity,
    child: this,
  );
}