diff --git a/lib/screen_util.dart b/lib/screen_util.dart index 70029c0..1257949 100644 --- a/lib/screen_util.dart +++ b/lib/screen_util.dart @@ -10,7 +10,7 @@ import 'package:flutter/material.dart'; class ScreenUtil { static const Size defaultSize = Size(360, 690); - static ScreenUtil _instance = ScreenUtil._(); + static late ScreenUtil _instance; /// UI设计中手机尺寸 , dp /// Size of the phone in UI Design , dp @@ -42,7 +42,7 @@ class ScreenUtil { Size designSize = defaultSize, bool allowFontScaling = false, }) { - _instance + _instance = ScreenUtil._() ..uiSize = designSize ..allowFontScaling = allowFontScaling .._orientation = orientation; diff --git a/lib/screenutil_init.dart b/lib/screenutil_init.dart index 815ae02..927b1d4 100644 --- a/lib/screenutil_init.dart +++ b/lib/screenutil_init.dart @@ -31,8 +31,9 @@ class ScreenUtilInit extends StatelessWidget { designSize: designSize, allowFontScaling: allowFontScaling, ); + return builder(); } - return builder(); + return Container(); }, ); });