116 lines
3.2 KiB
Dart
116 lines
3.2 KiB
Dart
|
import 'package:flutter/material.dart';
|
||
|
import 'quality/chartpart.dart';
|
||
|
import 'quality/singlebutton.dart';
|
||
|
import 'sky/skyInfo.dart';
|
||
|
import 'sky/skyInfoPlot_Page.dart';
|
||
|
import 'sky/skyPlot.dart';
|
||
|
|
||
|
void main() {
|
||
|
runApp(const MyApp());
|
||
|
}
|
||
|
|
||
|
class MyApp extends StatelessWidget {
|
||
|
const MyApp({super.key});
|
||
|
|
||
|
// This widget is the root of your application.
|
||
|
@override
|
||
|
Widget build(BuildContext context) {
|
||
|
final orientation = MediaQuery.of(context).orientation;
|
||
|
bool isPortrait = orientation == Orientation.portrait;
|
||
|
return MaterialApp(
|
||
|
title: 'gnssview',
|
||
|
home: ChartPart(groupColors: groupColors),
|
||
|
);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
// void main() {
|
||
|
// runApp(MyApp());
|
||
|
// }
|
||
|
|
||
|
// class MyApp extends StatelessWidget {
|
||
|
// @override
|
||
|
// Widget build(BuildContext context) {
|
||
|
// return MaterialApp(
|
||
|
// title: 'Chart Example',
|
||
|
// theme: ThemeData(
|
||
|
// primarySwatch: Colors.blue,
|
||
|
// ),
|
||
|
// home: SkyInfoPlotPage(),
|
||
|
// );
|
||
|
// }
|
||
|
// }
|
||
|
|
||
|
// class HomeScreen extends StatefulWidget {
|
||
|
// @override
|
||
|
// _HomeScreenState createState() => _HomeScreenState();
|
||
|
// }
|
||
|
|
||
|
// class _HomeScreenState extends State<HomeScreen> {
|
||
|
// Color selectedColor = Colors.blue; // 默认颜色
|
||
|
// List<Color> colors = [Colors.blue, Colors.red, Colors.green, Colors.orange];
|
||
|
// List<List<Color>> groupColors = []; // 存储每个组的颜色
|
||
|
|
||
|
// @override
|
||
|
// void initState() {
|
||
|
// super.initState();
|
||
|
// // 初始化每个组的颜色
|
||
|
// for (int i = 0; i < 4; i++) {
|
||
|
// groupColors
|
||
|
// .add([colors[i % colors.length], colors[(i + 1) % colors.length]]);
|
||
|
// }
|
||
|
// }
|
||
|
|
||
|
// void updateGroupColor(int groupIndex, Color color) {
|
||
|
// setState(() {
|
||
|
// for (int i = 0; i < groupColors.length; i++) {
|
||
|
// // 只保留与选中颜色相同的颜色
|
||
|
// groupColors[i] =
|
||
|
// groupColors[i].first == color ? [color] : [Colors.transparent];
|
||
|
// }
|
||
|
// });
|
||
|
// }
|
||
|
|
||
|
// String colorToString(Color color) {
|
||
|
// // 将颜色转换为字符串
|
||
|
// if (color == Colors.blue) return 'Blue';
|
||
|
// if (color == Colors.red) return 'Red';
|
||
|
// if (color == Colors.green) return 'Green';
|
||
|
// if (color == Colors.orange) return 'Orange';
|
||
|
// return 'Unknown Color';
|
||
|
// }
|
||
|
|
||
|
// @override
|
||
|
// Widget build(BuildContext context) {
|
||
|
// return Scaffold(
|
||
|
// appBar: AppBar(
|
||
|
// title: Text('信号质量'),
|
||
|
// ),
|
||
|
// body: OrientationBuilder(builder: (context, orientation) {
|
||
|
// return Column(
|
||
|
// children: [
|
||
|
// SingleButton(
|
||
|
// colors: colors,
|
||
|
// onSelectionChanged: (color) {
|
||
|
// setState(() {
|
||
|
// selectedColor = color; // 更新选中的颜色
|
||
|
// // 更新所有组为选中颜色
|
||
|
// for (int i = 0; i < groupColors.length; i++) {
|
||
|
// updateGroupColor(i, selectedColor);
|
||
|
// }
|
||
|
// });
|
||
|
// },
|
||
|
// ),
|
||
|
// Expanded(
|
||
|
// child: Center(
|
||
|
// child: ChartPart(groupColors: groupColors), // 将组颜色传递给 ChartPart
|
||
|
// ),
|
||
|
// ),
|
||
|
// ],
|
||
|
// );
|
||
|
// }),
|
||
|
// );
|
||
|
// }
|
||
|
// }
|