|
|
|
@ -10,8 +10,6 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|
|
|
import 'core/bindings/initial_binding.dart'; |
|
|
|
import 'routes/app_pages.dart'; |
|
|
|
import 'routes/app_routes.dart'; |
|
|
|
import 'dart:io'; |
|
|
|
import 'package:window_size/window_size.dart'; |
|
|
|
import 'core/translations/app_translations.dart'; |
|
|
|
import 'core/themes/app_theme.dart'; |
|
|
|
import 'core/themes/theme_service.dart'; |
|
|
|
@ -32,28 +30,6 @@ void main() async { |
|
|
|
// 初始化登录服务(包含Firebase初始化) |
|
|
|
LoginService(); |
|
|
|
|
|
|
|
// 设置窗口大小(仅在 macOS 下生效) |
|
|
|
if (Platform.isMacOS) { |
|
|
|
const double width = 375.0; |
|
|
|
const double height = 812.0; |
|
|
|
|
|
|
|
setWindowTitle('Voitrans'); |
|
|
|
setWindowMinSize(const Size(width, height)); |
|
|
|
setWindowMaxSize(const Size(width, height)); |
|
|
|
|
|
|
|
// 居中显示窗口 |
|
|
|
final screen = await getCurrentScreen(); |
|
|
|
if (screen != null) { |
|
|
|
final screenFrame = screen.frame; |
|
|
|
final windowFrame = Rect.fromCenter( |
|
|
|
center: screenFrame.center, |
|
|
|
width: width, |
|
|
|
height: height, |
|
|
|
); |
|
|
|
setWindowFrame(windowFrame); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 运行应用 |
|
|
|
runApp(const MainApp()); |
|
|
|
} |
|
|
|
|