李卓原

v5.9.0

# 5.9.0-beta
# 5.9.0
- 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
# 5.8.4
- bug fix
... ...
... ... @@ -3,11 +3,12 @@
export "FLUTTER_ROOT=/Users/lizhuoyuan/fvm/versions/stable"
export "FLUTTER_APPLICATION_PATH=/Users/lizhuoyuan/Development/Project/flutter_screenutil/example"
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
export "FLUTTER_TARGET=lib/main.dart"
export "FLUTTER_TARGET=/Users/lizhuoyuan/Development/Project/flutter_screenutil/example/lib/main.dart"
export "FLUTTER_BUILD_DIR=build"
export "FLUTTER_BUILD_NAME=1.0.0"
export "FLUTTER_BUILD_NUMBER=1"
export "DART_DEFINES=Zmx1dHRlci5pbnNwZWN0b3Iuc3RydWN0dXJlZEVycm9ycz10cnVl,RkxVVFRFUl9XRUJfQVVUT19ERVRFQ1Q9dHJ1ZQ==,RkxVVFRFUl9XRUJfQ0FOVkFTS0lUX1VSTD1odHRwczovL3d3dy5nc3RhdGljLmNvbS9mbHV0dGVyLWNhbnZhc2tpdC9jZGJlZGE3ODhhMjkzZmEyOTY2NWRjM2ZhM2Q2ZTYzYmQyMjFjYjBkLw=="
export "DART_OBFUSCATION=false"
export "TRACK_WIDGET_CREATION=true"
export "TREE_SHAKE_ICONS=false"
export "PACKAGE_CONFIG=.dart_tool/package_config.json"
export "PACKAGE_CONFIG=/Users/lizhuoyuan/Development/Project/flutter_screenutil/example/.dart_tool/package_config.json"
... ...
... ... @@ -3,6 +3,7 @@
* email: zhuoyuan93@gmail.com
*/
import 'dart:io';
import 'dart:math' show min, max;
import 'dart:ui' as ui show FlutterView;
... ... @@ -240,6 +241,37 @@ class ScreenUtil {
double setSp(num fontSize) =>
fontSizeResolver?.call(fontSize, _instance) ?? fontSize * scaleText;
DeviceType deviceType() {
DeviceType deviceType;
switch (Platform.operatingSystem) {
case 'android':
case 'ios':
deviceType = DeviceType.mobile;
if ((orientation == Orientation.portrait && screenWidth < 600) ||
(orientation == Orientation.landscape && screenHeight < 600)) {
deviceType = DeviceType.mobile;
} else {
deviceType = DeviceType.tablet;
}
break;
case 'linux':
deviceType = DeviceType.linux;
break;
case 'macos':
deviceType = DeviceType.mac;
break;
case 'windows':
deviceType = DeviceType.windows;
break;
case 'fuchsia':
deviceType = DeviceType.fuchsia;
break;
default:
deviceType = DeviceType.web;
}
return deviceType;
}
SizedBox setVerticalSpacing(num height) =>
SizedBox(height: setHeight(height));
... ... @@ -275,3 +307,5 @@ extension on MediaQueryData? {
return this;
}
}
enum DeviceType { mobile, tablet, web, mac, windows, linux, fuchsia }
... ...
name: flutter_screenutil
description: A flutter plugin for adapting screen and font size.Guaranteed to look good on different models
version: 5.9.0-beta
version: 5.9.0
homepage: https://github.com/OpenFlutter/flutter_screenutil
environment:
... ...