90 lines
2.6 KiB
Dart
90 lines
2.6 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:get/get.dart';
|
|
|
|
import '../Controller/gnss_controller.dart';
|
|
import 'chartpart.dart';
|
|
import 'singlebutton.dart';
|
|
|
|
// class SignalQuality extends StatefulWidget {
|
|
// @override
|
|
// _SignalQualityState createState() => _SignalQualityState();
|
|
// }
|
|
|
|
class SignalQuality extends StatelessWidget {
|
|
late final GnssController controller;
|
|
SignalQuality({super.key}) {
|
|
controller = Get.find<GnssController>();
|
|
controller.qselectedSystem.value = '';
|
|
}
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
appBar: AppBar(
|
|
toolbarHeight: 58,
|
|
title: Container(
|
|
alignment: Alignment.center,
|
|
child: Text('信号质量'),
|
|
),
|
|
leading: IconButton(
|
|
icon: Icon(Icons.arrow_back),
|
|
onPressed: () {
|
|
// Navigator.pop(context);
|
|
},
|
|
),
|
|
actions: [
|
|
IconButton(
|
|
icon: Container(
|
|
padding: EdgeInsets.symmetric(horizontal: 8.0, vertical: 4.0),
|
|
decoration: BoxDecoration(
|
|
border: Border.all(color: Colors.white),
|
|
borderRadius: BorderRadius.circular(4.0),
|
|
),
|
|
child: Image.asset(
|
|
'images/satellite.png',
|
|
width: 35,
|
|
height: 35,
|
|
),
|
|
),
|
|
onPressed: () {
|
|
Navigator.pop(context);
|
|
},
|
|
),
|
|
],
|
|
),
|
|
body: OrientationBuilder(builder: (context, orientation) {
|
|
return Column(
|
|
children: [
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
SingleButton(
|
|
QsignalColorList: const [
|
|
Color.fromARGB(255, 255, 0, 0),
|
|
Color.fromARGB(255, 0, 255, 0),
|
|
Color.fromARGB(255, 0, 0, 255),
|
|
Color.fromARGB(255, 146, 73, 206),
|
|
Color.fromARGB(255, 13, 179, 179),
|
|
],
|
|
onSelectionChanged: (color) {
|
|
String? name = controller.QselectedSignal[color];
|
|
if (name == null) {
|
|
return;
|
|
}
|
|
controller.qselectedSystem.value = name;
|
|
controller.baselineX.value = 0;
|
|
},
|
|
),
|
|
],
|
|
),
|
|
Expanded(
|
|
child: Center(
|
|
child: ChartPart(), // 将组颜色传递给 ChartPart
|
|
),
|
|
),
|
|
],
|
|
);
|
|
}),
|
|
);
|
|
}
|
|
}
|