SizeExtension extension

App-provided extensions that wrap flutter_screenutil so you can use ergonomic helpers like .w, .h, .sp, spacing widgets, and adapters for EdgeInsets, BorderRadius, Radius, and BoxConstraints.

We import flutter_screenutil as su and hide its own extension symbols to avoid name clashes with the extensions defined here. Scaling only applies when ResponsiveUtils.isNeedScreenUtil is true for the active breakpoint. Extension methods on num providing ScreenUtil-powered scaling and spacing helpers. These return scaled values only when ResponsiveUtils.isNeedScreenUtil is true; otherwise they return the raw numeric value for predictable behavior across breakpoints.

Examples:

  • 16.w, 24.h, 14.sp
  • 8.w.horizontalSpace, 12.h.verticalSpace
on

Properties

dg double

Available on num, provided by the SizeExtension extension

ScreenUtil.diagonal
no setter
dm double

Available on num, provided by the SizeExtension extension

ScreenUtil.diameter
no setter
h double

Available on num, provided by the SizeExtension extension

ScreenUtil.setHeight
no setter
horizontalSpace SizedBox

Available on num, provided by the SizeExtension extension

ScreenUtil.setWidth
no setter
horizontalSpaceDiagonal SizedBox

Available on num, provided by the SizeExtension extension

ScreenUtil.diagonal
no setter
horizontalSpaceDiameter SizedBox

Available on num, provided by the SizeExtension extension

ScreenUtil.diameter
no setter
horizontalSpaceRadius SizedBox

Available on num, provided by the SizeExtension extension

ScreenUtil.radius
no setter
r double

Available on num, provided by the SizeExtension extension

ScreenUtil.radius
no setter
sh double

Available on num, provided by the SizeExtension extension

屏幕高度的倍数 Multiple of screen height
no setter
sm double

Available on num, provided by the SizeExtension extension

no setter
sp double

Available on num, provided by the SizeExtension extension

ScreenUtil.setSp
no setter
spMax double

Available on num, provided by the SizeExtension extension

Largest of the raw value and its scaled font size counterpart. Useful to avoid text getting smaller than a specified minimum.
no setter
spMin double

Available on num, provided by the SizeExtension extension

smart size : it check your value - if it is bigger than your value it will set your value for example, you have set 16.sm() , if for your screen 16.sp() is bigger than 16 , then it will set 16 not 16.sp() I think that it is good for save size balance on big sizes of screen
no setter
sw double

Available on num, provided by the SizeExtension extension

屏幕宽度的倍数 Multiple of screen width
no setter
verticalSpace SizedBox

Available on num, provided by the SizeExtension extension

ScreenUtil.setHeight
no setter
verticalSpaceFromWidth SizedBox

Available on num, provided by the SizeExtension extension

ScreenUtil.setVerticalSpacingFromWidth
no setter
verticalSpacingDiagonal SizedBox

Available on num, provided by the SizeExtension extension

ScreenUtil.diagonal
no setter
verticalSpacingDiameter SizedBox

Available on num, provided by the SizeExtension extension

ScreenUtil.diameter
no setter
verticalSpacingRadius SizedBox

Available on num, provided by the SizeExtension extension

ScreenUtil.radius
no setter
w double

Available on num, provided by the SizeExtension extension

ScreenUtil.setWidth
no setter