2024-04-05 18:09:40 +08:00
|
|
|
|
|
|
|
|
import 'package:common/utils/toast_utils.dart';
|
|
|
|
|
import 'package:device_info_plus/device_info_plus.dart';
|
2024-03-30 10:58:39 +08:00
|
|
|
import 'package:flutter/material.dart';
|
2024-04-05 18:09:40 +08:00
|
|
|
import 'package:web_synchronization_tool/login/login_page.dart';
|
|
|
|
|
import 'package:web_synchronization_tool/login/login_socket_utils.dart';
|
2024-04-02 11:02:06 +08:00
|
|
|
import 'package:window_manager/window_manager.dart';
|
2024-03-30 10:58:39 +08:00
|
|
|
|
2024-03-31 20:15:43 +08:00
|
|
|
void main() async {
|
2024-04-02 11:02:06 +08:00
|
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
|
|
|
await windowManager.ensureInitialized();
|
2024-03-31 20:15:43 +08:00
|
|
|
|
2024-04-02 11:02:06 +08:00
|
|
|
WindowOptions windowOptions = const WindowOptions(
|
|
|
|
|
center: true, backgroundColor: Colors.white,// fullScreen: true,//, title: '赢佳'
|
|
|
|
|
// skipTaskbar: true, //跳过任务栏,任务栏无显示
|
|
|
|
|
// titleBarStyle: TitleBarStyle.hidden, //隐藏顶部标题栏
|
|
|
|
|
);
|
|
|
|
|
windowManager.waitUntilReadyToShow(windowOptions, () async {
|
|
|
|
|
await windowManager.show();
|
|
|
|
|
await windowManager.focus();
|
|
|
|
|
});
|
2024-03-31 20:15:43 +08:00
|
|
|
|
2024-03-30 10:58:39 +08:00
|
|
|
runApp(const MyApp());
|
|
|
|
|
}
|
|
|
|
|
|
2024-04-02 11:02:06 +08:00
|
|
|
class MyApp extends StatefulWidget {
|
2024-03-30 10:58:39 +08:00
|
|
|
const MyApp({super.key});
|
|
|
|
|
|
2024-04-02 11:02:06 +08:00
|
|
|
@override
|
|
|
|
|
State<MyApp> createState() => _MyAppState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _MyAppState extends State<MyApp> {
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
super.initState();
|
|
|
|
|
|
2024-04-05 18:09:40 +08:00
|
|
|
info();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
info() async {
|
|
|
|
|
final deviceInfo = await DeviceInfoPlugin().deviceInfo;
|
|
|
|
|
LoginSocketUtils.getInstance().uuid = deviceInfo.data.toString();
|
|
|
|
|
|
2024-04-02 11:02:06 +08:00
|
|
|
}
|
|
|
|
|
|
2024-03-30 10:58:39 +08:00
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return MaterialApp(
|
|
|
|
|
title: 'Flutter Demo',
|
|
|
|
|
theme: ThemeData(
|
|
|
|
|
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
|
|
|
|
|
useMaterial3: true,
|
|
|
|
|
),
|
2024-04-01 21:41:42 +08:00
|
|
|
// home: const MainPage(),
|
2024-04-05 18:09:40 +08:00
|
|
|
home: const LoginPage(),
|
|
|
|
|
navigatorObservers: [FlutterSmartDialog.observer],
|
|
|
|
|
builder: FlutterSmartDialog.init(),
|
2024-03-30 10:58:39 +08:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|