LiZhuoyuan

代码优化

#!/bin/sh
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=/Users/lizhuoyuan/Development/flutter"
export "FLUTTER_APPLICATION_PATH=/Users/lizhuoyuan/Development/Project/flutter_screenutil/example"
export "FLUTTER_TARGET=lib/main.dart"
export "FLUTTER_ROOT=D:\Develop\flutter"
export "FLUTTER_APPLICATION_PATH=D:\Develop\Project\flutter_screenutil\example"
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
export "FLUTTER_TARGET=lib\main.dart"
export "FLUTTER_BUILD_DIR=build"
export "SYMROOT=${SOURCE_ROOT}/../build/ios"
export "SYMROOT=${SOURCE_ROOT}/../build\ios"
export "FLUTTER_BUILD_NAME=1.0.0"
export "FLUTTER_BUILD_NUMBER=1"
export "DART_OBFUSCATION=false"
... ...
... ... @@ -16,9 +16,10 @@ class ScreenUtilInit extends StatelessWidget {
@override
Widget build(BuildContext context) {
return LayoutBuilder(builder: (_, BoxConstraints constraints) {
return OrientationBuilder(
builder: (_, Orientation orientation) {
if (constraints.maxWidth != 0) {
final Orientation orientation = constraints.maxWidth > constraints.maxHeight
? Orientation.landscape
: Orientation.portrait;
ScreenUtil.init(
constraints,
orientation: orientation,
... ... @@ -27,8 +28,6 @@ class ScreenUtilInit extends StatelessWidget {
return builder();
}
return Container();
},
);
});
}
}
... ...