gnssview_old/lib/main.dart
2024-07-31 23:37:51 +08:00

83 lines
2.0 KiB
Dart

import 'package:flutter/material.dart';
import 'package:get/get.dart';
// import 'package:gnss/gnss.dart';
import 'sky/sky_plot.dart';
import 'sky/sky_info.dart';
import 'Controller/gnss_controller.dart'; // Import the correct file location for GnssController
// void main() {
// Get.lazyPut<GnssController>(() => GnssController(), tag: 'gnss');
// 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) {
// return Scaffold(
// appBar: AppBar(
// title: Text('天空图'),
// ),
// body: SkyPlotPage(controller: Get.find(tag: 'gnss')));
// }
// }
void main() {
Get.put<GnssController>(GnssController());
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) {
// final con = Get.find<GnssController>();
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text('天空图'),
),
body: SkyInfo(),
));
}
}