首次提交
This commit is contained in:
33
lib/main.dart
Normal file
33
lib/main.dart
Normal file
@@ -0,0 +1,33 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:web_frontend/services/WebSocketService.dart';
|
||||
import 'package:web_frontend/views/ControlPanelView.dart';
|
||||
|
||||
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
// 初始化服务
|
||||
await Get.putAsync(() async => WebSocketService());
|
||||
|
||||
// 连接 WebSocket
|
||||
Get.find<WebSocketService>().connect();
|
||||
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget {
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
title: 'BLE Debug Control Panel',
|
||||
theme: ThemeData(
|
||||
primarySwatch: Colors.blue,
|
||||
useMaterial3: true,
|
||||
),
|
||||
home: ControlPanelView(),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user