You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
660 B
21 lines
660 B
import 'package:flutter/material.dart'; |
|
import 'package:flutter/services.dart'; |
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|
import 'package:get_storage/get_storage.dart'; |
|
import 'package:problem_check_system/app/app.dart'; |
|
|
|
void main() async { |
|
// 确保 Flutter Binding 已初始化 |
|
WidgetsFlutterBinding.ensureInitialized(); |
|
// 设置应用为竖屏模式 |
|
SystemChrome.setPreferredOrientations([ |
|
DeviceOrientation.portraitUp, |
|
DeviceOrientation.portraitDown, |
|
]); |
|
// 初始化 GetStorage,这是关键步骤 |
|
await GetStorage.init(); |
|
// Add this line |
|
await ScreenUtil.ensureScreenSize(); |
|
|
|
runApp(const MainApp()); |
|
}
|
|
|