Skip to content

Commit

Permalink
去掉第一次初始化失败时的断言错误
Browse files Browse the repository at this point in the history
  • Loading branch information
李卓原 committed Mar 11, 2021
1 parent 60bdec3 commit df0c80c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/screen_util.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -42,7 +42,7 @@ class ScreenUtil {
Size designSize = defaultSize,
bool allowFontScaling = false,
}) {
_instance
_instance = ScreenUtil._()
..uiSize = designSize
..allowFontScaling = allowFontScaling
.._orientation = orientation;
Expand Down
3 changes: 2 additions & 1 deletion lib/screenutil_init.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ class ScreenUtilInit extends StatelessWidget {
designSize: designSize,
allowFontScaling: allowFontScaling,
);
return builder();
}
return builder();
return Container();
},
);
});
Expand Down

0 comments on commit df0c80c

Please sign in to comment.