李卓原

代码优化

@@ -77,7 +77,6 @@ class ScreenUtil { @@ -77,7 +77,6 @@ class ScreenUtil {
77 static void init( 77 static void init(
78 BuildContext? context, { 78 BuildContext? context, {
79 Orientation? orientation, 79 Orientation? orientation,
80 - Size? deviceSize,  
81 Size designSize = defaultSize, 80 Size designSize = defaultSize,
82 bool splitScreenMode = false, 81 bool splitScreenMode = false,
83 bool minTextAdapt = false, 82 bool minTextAdapt = false,
@@ -86,7 +85,7 @@ class ScreenUtil { @@ -86,7 +85,7 @@ class ScreenUtil {
86 ? MediaQuery.maybeOf(context).nonEmptySizeOrNull() 85 ? MediaQuery.maybeOf(context).nonEmptySizeOrNull()
87 : null; 86 : null;
88 87
89 - deviceSize ??= deviceData?.size ?? designSize; 88 + Size deviceSize = deviceData?.size ?? designSize;
90 orientation ??= deviceData?.orientation ?? 89 orientation ??= deviceData?.orientation ??
91 (deviceSize.width > deviceSize.height 90 (deviceSize.width > deviceSize.height
92 ? Orientation.landscape 91 ? Orientation.landscape