38 lines
884 B
Dart
38 lines
884 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_terminal/config/router.dart';
|
|
import 'package:get/get.dart';
|
|
import 'package:window_manager/window_manager.dart';
|
|
|
|
void main() async {
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
// 必须加上这一行。
|
|
await windowManager.ensureInitialized();
|
|
|
|
WindowOptions windowOptions = const WindowOptions(
|
|
size: Size(1280, 800),
|
|
center: true,
|
|
titleBarStyle: TitleBarStyle.normal,
|
|
);
|
|
windowManager.waitUntilReadyToShow(windowOptions, () async {
|
|
await windowManager.show();
|
|
await windowManager.focus();
|
|
});
|
|
|
|
runApp(const MyApp());
|
|
}
|
|
|
|
class MyApp extends StatelessWidget {
|
|
const MyApp({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return GetMaterialApp(
|
|
initialRoute: RouteConfig.home,
|
|
getPages: RouteConfig.getPages,
|
|
enableLog: true,
|
|
|
|
);
|
|
}
|
|
}
|
|
|