gnssview_old/lib/main.dart

47 lines
1.1 KiB
Dart
Raw Normal View History

2024-07-31 19:04:11 +08:00
import 'package:flutter/material.dart';
import 'package:get/get.dart';
2024-07-31 23:37:51 +08:00
// import 'package:gnss/gnss.dart';
2024-07-30 18:20:27 +08:00
2024-07-31 23:37:51 +08:00
import 'sky/sky_plot.dart';
import 'sky/sky_info.dart';
import 'Controller/gnss_controller.dart'; // Import the correct file location for GnssController
2024-07-30 18:20:27 +08:00
2024-07-31 19:04:11 +08:00
void main() {
2024-07-31 23:37:51 +08:00
Get.put<GnssController>(GnssController());
2024-07-31 19:04:11 +08:00
runApp(MyApp());
}
// Gnss gnss = Gnss(port: "/dev/ttysWK2", baudrate: 115200);
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
void initState() {
super.initState();
// 初始化每个组的颜色
// gnss.start();
// gnss.locationStream.listen((location) {
// log(location.toString() as num);
// });
// gnss.signalStream.listen((location) {
// log(location.toString() as num);
// });
}
@override
Widget build(BuildContext context) {
2024-07-31 23:37:51 +08:00
// final con = Get.find<GnssController>();
2024-07-31 19:04:11 +08:00
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text('天空图'),
),
2024-08-01 14:08:34 +08:00
body: SkyInfoPlotPage(),
2024-07-31 19:04:11 +08:00
));
}
}