Showing
7 changed files
with
81 additions
and
20 deletions
| 1 | +# 5.0.1+2 | ||
| 2 | + | ||
| 3 | +- Text adaptation no longer considers the height of the screen | ||
| 4 | + | ||
| 5 | +# 5.0.1+1 | ||
| 6 | + | ||
| 7 | +- split default value change to false | ||
| 8 | + | ||
| 1 | # 5.0.1 | 9 | # 5.0.1 |
| 10 | + | ||
| 2 | - support for split screen | 11 | - support for split screen |
| 3 | - add number.sm (return min(number.sp , number)) | 12 | - add number.sm (return min(number.sp , number)) |
| 4 | 13 | ||
| 5 | # 5.0.0+2 | 14 | # 5.0.0+2 |
| 15 | + | ||
| 6 | - update readme | 16 | - update readme |
| 7 | 17 | ||
| 8 | # 5.0.0+1 | 18 | # 5.0.0+1 |
| 19 | + | ||
| 9 | - update readme | 20 | - update readme |
| 10 | 21 | ||
| 11 | # 5.0.0 | 22 | # 5.0.0 |
| 12 | --Breaking change. Use a new way to set font scaling | ||
| 13 | --Deprecated ssp and nsp | 23 | + |
| 24 | +-Breaking change. Use a new way to set font scaling -Deprecated ssp and nsp | ||
| 14 | 25 | ||
| 15 | # 5.0.0-nullsafety.11 | 26 | # 5.0.0-nullsafety.11 |
| 27 | + | ||
| 16 | - revert 5.0.0-nullsafety.10 | 28 | - revert 5.0.0-nullsafety.10 |
| 17 | - fix #230 | 29 | - fix #230 |
| 18 | 30 | ||
| 19 | # 5.0.0-nullsafety.10 | 31 | # 5.0.0-nullsafety.10 |
| 32 | + | ||
| 20 | - fix #228 | 33 | - fix #228 |
| 21 | 34 | ||
| 22 | # 5.0.0-nullsafety.9 | 35 | # 5.0.0-nullsafety.9 |
| 36 | + | ||
| 23 | - Supplementary documentation, supports two initialization methods | 37 | - Supplementary documentation, supports two initialization methods |
| 24 | 38 | ||
| 25 | # 5.0.0-nullsafety.8 | 39 | # 5.0.0-nullsafety.8 |
| 40 | + | ||
| 26 | - merge v4 | 41 | - merge v4 |
| 27 | - Add a method to get the screen orientation | 42 | - Add a method to get the screen orientation |
| 28 | 43 | ||
| 29 | # 5.0.0-nullsafety.7 | 44 | # 5.0.0-nullsafety.7 |
| 45 | + | ||
| 30 | - fix #221 | 46 | - fix #221 |
| 31 | 47 | ||
| 32 | # 5.0.0-nullsafety.6 | 48 | # 5.0.0-nullsafety.6 |
| 49 | + | ||
| 33 | - merge #216 #218 | 50 | - merge #216 #218 |
| 34 | 51 | ||
| 35 | # 5.0.0-nullsafety.5 | 52 | # 5.0.0-nullsafety.5 |
| 53 | + | ||
| 36 | - Optimize initialization method | 54 | - Optimize initialization method |
| 37 | 55 | ||
| 38 | # 5.0.0-nullsafety.4 | 56 | # 5.0.0-nullsafety.4 |
| 57 | + | ||
| 39 | - merge #205 | 58 | - merge #205 |
| 40 | 59 | ||
| 41 | # 5.0.0-nullsafety.3 | 60 | # 5.0.0-nullsafety.3 |
| 61 | + | ||
| 42 | - merge 4.0.2+3 | 62 | - merge 4.0.2+3 |
| 43 | 63 | ||
| 44 | # 5.0.0-nullsafety.2 | 64 | # 5.0.0-nullsafety.2 |
| 65 | + | ||
| 45 | - merge 4.0.2+2 #186 | 66 | - merge 4.0.2+2 #186 |
| 46 | 67 | ||
| 47 | # 5.0.0-nullsafety.1 | 68 | # 5.0.0-nullsafety.1 |
| 69 | + | ||
| 48 | - merge 4.0.1 ,4.0.2 #183 | 70 | - merge 4.0.1 ,4.0.2 #183 |
| 49 | 71 | ||
| 50 | # 5.0.0-nullsafety.0 | 72 | # 5.0.0-nullsafety.0 |
| 73 | + | ||
| 51 | - Migrated flutter_screenutil to non-nullable | 74 | - Migrated flutter_screenutil to non-nullable |
| 52 | 75 | ||
| 53 | # 4.0.2 | 76 | # 4.0.2 |
| 77 | + | ||
| 54 | - add r(),adapt according to the smaller of width or height | 78 | - add r(),adapt according to the smaller of width or height |
| 55 | 79 | ||
| 56 | # 4.0.1 | 80 | # 4.0.1 |
| 81 | + | ||
| 57 | - Modify the initialization unit to dp | 82 | - Modify the initialization unit to dp |
| 58 | - delete screenWidthPx and screenHeightPx(No one use these method,I guess) | 83 | - delete screenWidthPx and screenHeightPx(No one use these method,I guess) |
| 59 | 84 | ||
| 60 | # 4.0.0 | 85 | # 4.0.0 |
| 86 | + | ||
| 61 | - update to 4.0.0 | 87 | - update to 4.0.0 |
| 62 | 88 | ||
| 63 | # 4.0.0-beta3 | 89 | # 4.0.0-beta3 |
| 90 | + | ||
| 64 | - Optimize the way of initialization | 91 | - Optimize the way of initialization |
| 65 | 92 | ||
| 66 | # 4.0.0-beta2 | 93 | # 4.0.0-beta2 |
| 94 | + | ||
| 67 | - fix error:'window is not a type.' | 95 | - fix error:'window is not a type.' |
| 68 | 96 | ||
| 69 | # 4.0.0-beta1 | 97 | # 4.0.0-beta1 |
| 98 | + | ||
| 70 | - change readme | 99 | - change readme |
| 71 | 100 | ||
| 72 | # 4.0.0-beta | 101 | # 4.0.0-beta |
| 102 | + | ||
| 73 | - Modified the initialization method | 103 | - Modified the initialization method |
| 74 | - Support font adaptation in themedata | 104 | - Support font adaptation in themedata |
| 75 | 105 | ||
| 76 | # 3.2.0 | 106 | # 3.2.0 |
| 107 | + | ||
| 77 | - Modify the method name to be more semantic: wp->sw , hp->sh | 108 | - Modify the method name to be more semantic: wp->sw , hp->sh |
| 78 | - Remove the restriction of flutter version | 109 | - Remove the restriction of flutter version |
| 79 | - Modify the return type num to double | 110 | - Modify the return type num to double |
| 80 | 111 | ||
| 81 | # 3.1.1 | 112 | # 3.1.1 |
| 113 | + | ||
| 82 | - change readme | 114 | - change readme |
| 83 | 115 | ||
| 84 | # 3.1.0 | 116 | # 3.1.0 |
| 117 | + | ||
| 85 | - Use the way back to v2 version | 118 | - Use the way back to v2 version |
| 86 | - Modify registration method | 119 | - Modify registration method |
| 87 | 120 | ||
| 88 | # 3.0.2+1 | 121 | # 3.0.2+1 |
| 122 | + | ||
| 89 | - Guide users to use V2 version | 123 | - Guide users to use V2 version |
| 90 | 124 | ||
| 91 | # 3.0.2 | 125 | # 3.0.2 |
| 126 | + | ||
| 92 | - Change the unit of'statusBarHeight' and 'bottomBarHeight' to dp | 127 | - Change the unit of'statusBarHeight' and 'bottomBarHeight' to dp |
| 93 | 128 | ||
| 94 | # 3.0.1 | 129 | # 3.0.1 |
| 130 | + | ||
| 95 | - update readme | 131 | - update readme |
| 96 | 132 | ||
| 97 | # 3.0.0 | 133 | # 3.0.0 |
| 134 | + | ||
| 98 | - After a period of experimentation, I think it's time to release the official version | 135 | - After a period of experimentation, I think it's time to release the official version |
| 99 | 136 | ||
| 100 | # 3.0.0-beta.2 | 137 | # 3.0.0-beta.2 |
| 138 | + | ||
| 101 | - readme update | 139 | - readme update |
| 102 | 140 | ||
| 103 | # 3.0.0-beta.1 | 141 | # 3.0.0-beta.1 |
| 142 | + | ||
| 104 | **BREAKING CHANGES** | 143 | **BREAKING CHANGES** |
| 144 | + | ||
| 105 | - `BuildContext` is no more required while initializing. i.e. ScreenUtil.init(~~context~~) | 145 | - `BuildContext` is no more required while initializing. i.e. ScreenUtil.init(~~context~~) |
| 106 | - Initialize size of design draft using `designSize` instead of width & height. | 146 | - Initialize size of design draft using `designSize` instead of width & height. |
| 107 | - All the static methods are now member methods. | 147 | - All the static methods are now member methods. |
| 108 | 148 | ||
| 109 | # 2.3.1 | 149 | # 2.3.1 |
| 150 | + | ||
| 110 | - add textStyle Example. | 151 | - add textStyle Example. |
| 111 | 152 | ||
| 112 | # 2.3.0 | 153 | # 2.3.0 |
| 154 | + | ||
| 113 | - We still need context to initialize, sorry. | 155 | - We still need context to initialize, sorry. |
| 114 | 156 | ||
| 115 | # 2.2.0 | 157 | # 2.2.0 |
| 158 | + | ||
| 116 | - add 'wp','hp'. Get the height/width of the screen proportionally | 159 | - add 'wp','hp'. Get the height/width of the screen proportionally |
| 117 | - For example: 0.5.wp : Half the width of the screen. | 160 | - For example: 0.5.wp : Half the width of the screen. |
| 118 | 161 | ||
| 119 | # 2.1.0 | 162 | # 2.1.0 |
| 120 | -- add 'nsp' , you can use 'fontSize: 24.nsp' instead of 'fontSize: ScreenUtil().setSp(24, allowFontScalingSelf: false)' | 163 | + |
| 164 | +- add 'nsp' , you can use 'fontSize: 24.nsp' instead of 'fontSize: ScreenUtil().setSp(24, | ||
| 165 | + allowFontScalingSelf: false)' | ||
| 121 | 166 | ||
| 122 | # 2.0.0 | 167 | # 2.0.0 |
| 123 | -- Use `MediaQueryData.fromWindow(window)` instead of `MediaQuery.of(context)`, no context parameter required | 168 | + |
| 169 | +- Use `MediaQueryData.fromWindow(window)` instead of `MediaQuery.of(context)`, no context parameter | ||
| 170 | + required | ||
| 124 | - API changes, please note | 171 | - API changes, please note |
| 125 | 172 | ||
| 126 | # 1.1.0 | 173 | # 1.1.0 |
| 174 | + | ||
| 127 | - support ExtensionMethod Dart-SDK-2.6.0 | 175 | - support ExtensionMethod Dart-SDK-2.6.0 |
| 128 | - you can use 'width: 50.w' instead of 'width: ScreenUtil().setWidth(50)' | 176 | - you can use 'width: 50.w' instead of 'width: ScreenUtil().setWidth(50)' |
| 129 | '50.h' instead of 'ScreenUtil().setHeight(50)' | 177 | '50.h' instead of 'ScreenUtil().setHeight(50)' |
| @@ -131,18 +179,20 @@ | @@ -131,18 +179,20 @@ | ||
| 131 | '24.ssp' instead of 'ScreenUtil().setSp(24, allowFontScalingSelf: true)' | 179 | '24.ssp' instead of 'ScreenUtil().setSp(24, allowFontScalingSelf: true)' |
| 132 | 180 | ||
| 133 | # 1.0.2 | 181 | # 1.0.2 |
| 182 | + | ||
| 134 | - fix #89 | 183 | - fix #89 |
| 135 | - 优化屏幕旋转效果 | 184 | - 优化屏幕旋转效果 |
| 136 | - 字体适配统一使用宽度 | 185 | - 字体适配统一使用宽度 |
| 137 | 186 | ||
| 138 | # 1.0.1 | 187 | # 1.0.1 |
| 139 | -- Rebuild code, change API | ||
| 140 | - Delete "getInstance()", please use "ScreenUtil ()" instead of "ScreenUtil.getInstance()" | ||
| 141 | - use "ScreenUtil().setSp(24, allowFontScalingSelf: true)" instead of "ScreenUtil.getInstance().setSp(14, true)" | 188 | + |
| 189 | +- Rebuild code, change API Delete "getInstance()", please use "ScreenUtil ()" instead of " | ||
| 190 | + ScreenUtil.getInstance()" | ||
| 191 | + use "ScreenUtil().setSp(24, allowFontScalingSelf: true)" instead of "ScreenUtil.getInstance() | ||
| 192 | + .setSp(14, true)" | ||
| 142 | - Modify the initialization method | 193 | - Modify the initialization method |
| 143 | - Fix #68 | 194 | - Fix #68 |
| 144 | -- Change example code | ||
| 145 | - Example CompileSdkVersion change to 28 | 195 | +- Change example code Example CompileSdkVersion change to 28 |
| 146 | 196 | ||
| 147 | **If there is significant impact, please return to 0.7.0** | 197 | **If there is significant impact, please return to 0.7.0** |
| 148 | 198 | ||
| @@ -174,7 +224,8 @@ | @@ -174,7 +224,8 @@ | ||
| 174 | 224 | ||
| 175 | - Fix the wrong way of using | 225 | - Fix the wrong way of using |
| 176 | 226 | ||
| 177 | -- It is recommended to use `ScreenUtil.getInstance()` instead of `ScreenUtil()` , for example: `ScreenUtil.getInstance().setHeight(25)` instead of `ScreenUtil().setHeight(25)` | 227 | +- It is recommended to use `ScreenUtil.getInstance()` instead of `ScreenUtil()` , for |
| 228 | + example: `ScreenUtil.getInstance().setHeight(25)` instead of `ScreenUtil().setHeight(25)` | ||
| 178 | 229 | ||
| 179 | # 0.4.4 | 230 | # 0.4.4 |
| 180 | 231 | ||
| @@ -184,9 +235,9 @@ | @@ -184,9 +235,9 @@ | ||
| 184 | 235 | ||
| 185 | - Modify the font to change with the system zoom mode. The default value is false. | 236 | - Modify the font to change with the system zoom mode. The default value is false. |
| 186 | 237 | ||
| 187 | -- setSp(int fontSize, [allowFontScaling = false]) => allowFontScaling | ||
| 188 | -? setWidth(fontSize) \* \_textScaleFactor | ||
| 189 | -: setWidth(fontSize); | 238 | +- setSp(int fontSize, [allowFontScaling = false]) => allowFontScaling ? setWidth(fontSize) \* |
| 239 | + \_textScaleFactor | ||
| 240 | + : setWidth(fontSize); | ||
| 190 | 241 | ||
| 191 | # 0.4.2 | 242 | # 0.4.2 |
| 192 | 243 | ||
| @@ -210,9 +261,10 @@ | @@ -210,9 +261,10 @@ | ||
| 210 | # 0.3.1 | 261 | # 0.3.1 |
| 211 | 262 | ||
| 212 | - Perfect documentation | 263 | - Perfect documentation |
| 213 | -- Width is enlarged relative to the design draft => The ratio of font and width to the size of the design | ||
| 214 | -- Height is enlarged relative to the design draft => The ratio of height width to the size of the design | ||
| 215 | - | 264 | +- Width is enlarged relative to the design draft => The ratio of font and width to the size of the |
| 265 | + design | ||
| 266 | +- Height is enlarged relative to the design draft => The ratio of height width to the size of the | ||
| 267 | + design | ||
| 216 | 268 | ||
| 217 | # 0.3.0 | 269 | # 0.3.0 |
| 218 | 270 |
| 1 | # flutter_screenutil | 1 | # flutter_screenutil |
| 2 | [](https://pub.dev/packages/flutter_screenutil) | 2 | [](https://pub.dev/packages/flutter_screenutil) |
| 3 | +[](https://pub.dev/packages/flutter_screenutil/score) | ||
| 4 | +[](https://pub.dev/packages/flutter_screenutil/score) | ||
| 3 | 5 | ||
| 4 | **A flutter plugin for adapting screen and font size.Let your UI display a reasonable layout on different screen sizes!** | 6 | **A flutter plugin for adapting screen and font size.Let your UI display a reasonable layout on different screen sizes!** |
| 5 | 7 |
| 1 | -# flutter_screenUtil | 1 | +# flutter_screenutil |
| 2 | 2 | ||
| 3 | [](https://pub.dartlang.org/packages/flutter_screenutil) | 3 | [](https://pub.dartlang.org/packages/flutter_screenutil) |
| 4 | +[](https://pub.dev/packages/flutter_screenutil/score) | ||
| 5 | +[](https://pub.dev/packages/flutter_screenutil/score) | ||
| 4 | 6 | ||
| 5 | **flutter 屏幕适配方案,让你的UI在不同尺寸的屏幕上都能显示合理的布局!** | 7 | **flutter 屏幕适配方案,让你的UI在不同尺寸的屏幕上都能显示合理的布局!** |
| 6 | 8 |
| 1 | # I don’t speak Portuguese, and other developers have translated the first version. I later modified it based on the translation software. It is recommended to read the English/Chinese version. | 1 | # I don’t speak Portuguese, and other developers have translated the first version. I later modified it based on the translation software. It is recommended to read the English/Chinese version. |
| 2 | # flutter_screenutil | 2 | # flutter_screenutil |
| 3 | [](https://pub.dartlang.org/packages/flutter_screenutil) | 3 | [](https://pub.dartlang.org/packages/flutter_screenutil) |
| 4 | +[](https://pub.dev/packages/flutter_screenutil/score) | ||
| 5 | +[](https://pub.dev/packages/flutter_screenutil/score) | ||
| 4 | 6 | ||
| 5 | **Um plugin Flutter para adaptação de tamanho de tela e fontes. Deixe sua UI exibir um layout aceitável em diferentes tamanhos de tela!** | 7 | **Um plugin Flutter para adaptação de tamanho de tela e fontes. Deixe sua UI exibir um layout aceitável em diferentes tamanhos de tela!** |
| 6 | 8 |
| @@ -9,6 +9,7 @@ class MyApp extends StatelessWidget { | @@ -9,6 +9,7 @@ class MyApp extends StatelessWidget { | ||
| 9 | //Set the fit size (fill in the screen size of the device in the design) If the design is based on the size of the iPhone6 (iPhone6 750*1334) | 9 | //Set the fit size (fill in the screen size of the device in the design) If the design is based on the size of the iPhone6 (iPhone6 750*1334) |
| 10 | return ScreenUtilInit( | 10 | return ScreenUtilInit( |
| 11 | designSize: Size(360, 690), | 11 | designSize: Size(360, 690), |
| 12 | + splitScreenMode: true, | ||
| 12 | builder: () => MaterialApp( | 13 | builder: () => MaterialApp( |
| 13 | debugShowCheckedModeBanner: false, | 14 | debugShowCheckedModeBanner: false, |
| 14 | title: 'Flutter_ScreenUtil', | 15 | title: 'Flutter_ScreenUtil', |
| @@ -97,6 +98,7 @@ class _HomePageState extends State<HomePage> { | @@ -97,6 +98,7 @@ class _HomePageState extends State<HomePage> { | ||
| 97 | ), | 98 | ), |
| 98 | ), | 99 | ), |
| 99 | ), | 100 | ), |
| 101 | + TextField(style: TextStyle(fontSize: 180.sp)), | ||
| 100 | Text('Device width:${ScreenUtil().screenWidth}dp'), | 102 | Text('Device width:${ScreenUtil().screenWidth}dp'), |
| 101 | Text('Device height:${ScreenUtil().screenHeight}dp'), | 103 | Text('Device height:${ScreenUtil().screenHeight}dp'), |
| 102 | Text('Device pixel density:${ScreenUtil().pixelRatio}'), | 104 | Text('Device pixel density:${ScreenUtil().pixelRatio}'), |
| @@ -148,7 +150,8 @@ class _HomePageState extends State<HomePage> { | @@ -148,7 +150,8 @@ class _HomePageState extends State<HomePage> { | ||
| 148 | print('Bottom safe zone distance dp:${ScreenUtil().bottomBarHeight}dp'); | 150 | print('Bottom safe zone distance dp:${ScreenUtil().bottomBarHeight}dp'); |
| 149 | print('Status bar height dp:${ScreenUtil().statusBarHeight}dp'); | 151 | print('Status bar height dp:${ScreenUtil().statusBarHeight}dp'); |
| 150 | print('The ratio of actual width to UI design:${ScreenUtil().scaleWidth}'); | 152 | print('The ratio of actual width to UI design:${ScreenUtil().scaleWidth}'); |
| 151 | - print('The ratio of actual height to UI design:${ScreenUtil().scaleHeight}'); | 153 | + print( |
| 154 | + 'The ratio of actual height to UI design:${ScreenUtil().scaleHeight}'); | ||
| 152 | print('System font scaling:${ScreenUtil().textScaleFactor}'); | 155 | print('System font scaling:${ScreenUtil().textScaleFactor}'); |
| 153 | print('0.5 times the screen width:${0.5.sw}dp'); | 156 | print('0.5 times the screen width:${0.5.sw}dp'); |
| 154 | print('0.5 times the screen height:${0.5.sh}dp'); | 157 | print('0.5 times the screen height:${0.5.sh}dp'); |
| @@ -84,7 +84,7 @@ class ScreenUtil { | @@ -84,7 +84,7 @@ class ScreenUtil { | ||
| 84 | /// /// The ratio of actual height to UI design | 84 | /// /// The ratio of actual height to UI design |
| 85 | double get scaleHeight => _screenHeight / uiSize.height; | 85 | double get scaleHeight => _screenHeight / uiSize.height; |
| 86 | 86 | ||
| 87 | - double get scaleText => min(scaleWidth, scaleHeight); | 87 | + double get scaleText => scaleWidth; |
| 88 | 88 | ||
| 89 | /// 根据UI设计的设备宽度适配 | 89 | /// 根据UI设计的设备宽度适配 |
| 90 | /// 高度也可以根据这个来做适配可以保证不变形,比如你想要一个正方形的时候. | 90 | /// 高度也可以根据这个来做适配可以保证不变形,比如你想要一个正方形的时候. |
| 1 | name: flutter_screenutil | 1 | name: flutter_screenutil |
| 2 | description: A flutter plugin for adapting screen and font size.Guaranteed to look good on different models | 2 | description: A flutter plugin for adapting screen and font size.Guaranteed to look good on different models |
| 3 | -version: 5.0.1 | 3 | +version: 5.0.1+2 |
| 4 | homepage: https://github.com/OpenFlutter/flutter_screenutil | 4 | homepage: https://github.com/OpenFlutter/flutter_screenutil |
| 5 | 5 | ||
| 6 | environment: | 6 | environment: |
-
Please register or login to post a comment