Showing
1 changed file
with
6 additions
and
0 deletions
@@ -207,6 +207,12 @@ class ScreenUtil { | @@ -207,6 +207,12 @@ class ScreenUtil { | ||
207 | ///Adapt according to the smaller of width or height | 207 | ///Adapt according to the smaller of width or height |
208 | double radius(num r) => r * min(scaleWidth, scaleHeight); | 208 | double radius(num r) => r * min(scaleWidth, scaleHeight); |
209 | 209 | ||
210 | + /// Adapt according to the both width and height | ||
211 | + double diagonal(num d) => d * scaleHeight * scaleWidth; | ||
212 | + | ||
213 | + /// Adapt according to the maximum value of scale width and scale height | ||
214 | + double diameter(num d) => d * max(scaleWidth, scaleHeight); | ||
215 | + | ||
210 | ///字体大小适配方法 | 216 | ///字体大小适配方法 |
211 | ///- [fontSize] UI设计上字体的大小,单位dp. | 217 | ///- [fontSize] UI设计上字体的大小,单位dp. |
212 | ///Font size adaptation method | 218 | ///Font size adaptation method |
-
Please register or login to post a comment