feat: support for disabling scaling
- Add ability to exclude widgets from from rebuild list
- Depend on View instead of MediaQuery
- update readme
- merge pr #550 #555 #556
- update readme
- ScreenUtilInit won't rebuild the whole widget tree
- Add
fontSizeResolver
to specify how font size should be scaled - Add
diameter
&diagonal
factors useInheritedMediaQuery
has not effect, and will be removed in next release- Fix
ensureScreenSize
in web platform - add deviceType
- bug fix
- change useInheritedMediaQuery default value to false
- Adapt to flutter3.10
- change useInheritedMediaQuery default value to true
- update readme
- remove ScreenutilInit layout listener
- Limit flutter version > 3.10.0
- merge #464
- add spMax => max(toDouble(), sp), and spMin, for example: 12.spMax
- FlutterView instead of FlutterWindow
- bug fix: #434
- add w and h on EdgeInsets,Radius,BorderRadius,BoxConstraints
- Bug Fix: False sizes when using DevicePreview
- Fix #398
- Fix compatibility with flutter sdk 2.x
- Bug Fix: Some widgets disapear because of parent rebuild.
- Bug Fix: issue #362. Null check operator used on a null value when using ScreenUtil.init().
- Re-add context to builder parameters (users request).
- Add some standard rebuild factors.
- Add rebuildFactor property
- Bug Fix: False sizes when resizing
- Bug Fix: Assertion Failed (Find MediaQuery in ancestors)
- Some performance improvements and fixes
- Bug Fix: Reaching context that no longer used.
- delete log
- merge #352
- add num.verticalSpacingRadius num.horizontalSpaceRadius num.setVerticalSpacingFromWidth
- update num.horizontalSpace
- For the size, use the context to get it first, which needs to provide the Context More rigorous context checking
- Rollback of 5.1.1 commit
- Fix the problem of inaccurate height
- merge #332(#332) add num.setVerticalSpacing // SizedBox(height: num * scaleHeight) num.horizontalSpace // SizedBox(height: num * scaleWidth)
- .w,.h use MediaQuery
- Break Change: updated the first initialization method, please refer to README.md
- Break Change : add setContext() , the first initialization method requires calling
- fix # 310
- update ReadMe.md
- init method add "context" param
- update ReadMe.md
- fix splitScreenMode to false
- add "minTextAdapt" param , Font adaptation is based on the minimum value of width and height or only based on width(default)
- update readme
- fix .r
- Text adaptation no longer considers the height of the screen
- split default value change to false
- support for split screen
- add number.sm (return min(number.sp , number))
- update readme
- update readme
-Breaking change. Use a new way to set font scaling -Deprecated ssp and nsp
- revert 5.0.0-nullsafety.10
- fix #230
- fix #228
- Supplementary documentation, supports two initialization methods
- merge v4
- Add a method to get the screen orientation
- fix #221
- merge #216 #218
- Optimize initialization method
- merge #205
- merge 4.0.2+3
- merge 4.0.2+2 #186
- merge 4.0.1 ,4.0.2 #183
- Migrated flutter_screenutil to non-nullable
- add r(),adapt according to the smaller of width or height
- Modify the initialization unit to dp
- delete screenWidthPx and screenHeightPx(No one use these method,I guess)
- update to 4.0.0
- Optimize the way of initialization
- fix error:'window is not a type.'
- change readme
- Modified the initialization method
- Support font adaptation in themedata
- Modify the method name to be more semantic: wp->sw , hp->sh
- Remove the restriction of flutter version
- Modify the return type num to double
- change readme
- Use the way back to v2 version
- Modify registration method
- Guide users to use V2 version
- Change the unit of'statusBarHeight' and 'bottomBarHeight' to dp
- update readme
- After a period of experimentation, I think it's time to release the official version
- readme update
BREAKING CHANGES
BuildContext
is no more required while initializing. i.e. ScreenUtil.init(context)- Initialize size of design draft using
designSize
instead of width & height. - All the static methods are now member methods.
- add textStyle Example.
- We still need context to initialize, sorry.
- add 'wp','hp'. Get the height/width of the screen proportionally
- For example: 0.5.wp : Half the width of the screen.
- add 'nsp' , you can use 'fontSize: 24.nsp' instead of 'fontSize: ScreenUtil().setSp(24, allowFontScalingSelf: false)'
- Use
MediaQueryData.fromWindow(window)
instead ofMediaQuery.of(context)
, no context parameter required - API changes, please note
- support ExtensionMethod Dart-SDK-2.6.0
- you can use 'width: 50.w' instead of 'width: ScreenUtil().setWidth(50)' '50.h' instead of 'ScreenUtil().setHeight(50)' '24.sp' instead of 'ScreenUtil().setSp(24)' '24.ssp' instead of 'ScreenUtil().setSp(24, allowFontScalingSelf: true)'
- fix #89
- 优化屏幕旋转效果
- 字体适配统一使用宽度
- Rebuild code, change API Delete "getInstance()", please use "ScreenUtil ()" instead of " ScreenUtil.getInstance()" use "ScreenUtil().setSp(24, allowFontScalingSelf: true)" instead of "ScreenUtil.getInstance() .setSp(14, true)"
- Modify the initialization method
- Fix #68
- Change example code Example CompileSdkVersion change to 28
If there is significant impact, please return to 0.7.0
- Replace textScaleFactory with textScaleFactor , It's a typo.
- Add return types to all methods.
- Completing comments , adding English commentsWelcome to add, correct
- 参数同时支持传入 int / double 或者是var size = 100 , var size = 100.0.
- The argument also supports passing in in / double / var size = 100 /var size = 100.0
- Change the units of statusBarHeight and bottomBarHeight to dp
-
Change the parameter type from int to double
-
setWidth,setHeight,setSp. for example: you can use setWidth(100) or setWidth(100.0)
-
Fix the wrong way of using
-
It is recommended to use
ScreenUtil.getInstance()
instead ofScreenUtil()
, for example:ScreenUtil.getInstance().setHeight(25)
instead ofScreenUtil().setHeight(25)
- Fix bugs that default fonts change with the system
-
Modify the font to change with the system zoom mode. The default value is false.
-
setSp(int fontSize, [allowFontScaling = false]) => allowFontScaling ? setWidth(fontSize) * _textScaleFactor : setWidth(fontSize);
-
add two Properties
-
///Current device width dp
-
///当前设备宽度 dp
-
ScreenUtil.screenWidthDp
-
///Current device height dp
-
///当前设备高度 dp
-
ScreenUtil.screenHeightDp
- Fix font adaptation issues
- Optimize font adaptation method
- Perfect documentation
- Width is enlarged relative to the design draft => The ratio of font and width to the size of the design
- Height is enlarged relative to the design draft => The ratio of height width to the size of the design
- Add font size adaptation
- Optimize documentation
- Fixed bug when releasing
- first version