CFG重新修改

This commit is contained in:
tanlinxing 2024-11-21 10:10:51 +08:00
parent 58ec37a7c5
commit 8863427829
2 changed files with 23 additions and 22 deletions

View File

@ -69,7 +69,7 @@ class RealDataController extends GetxController {
final name = '桩点名称'.obs; final name = '桩点名称'.obs;
final sid = '10.222'.obs; final sid = '10.222'.obs;
final times = 10.obs; final times = 10.obs;
late final isClick = false.obs; final isClicked = false.obs;
late final lineDis = 110.0.obs; late final lineDis = 110.0.obs;
late final distance = 460.0.obs; late final distance = 460.0.obs;

View File

@ -10,8 +10,7 @@ import '../aim_point/aimpoint_page.dart';
import 'controller.dart'; import 'controller.dart';
class RealDataContainer extends StatelessWidget { class RealDataContainer extends StatelessWidget {
final PlumRealDataController controller = Get.put(PlumRealDataController()); final RealDataController controller = Get.find<RealDataController>();
final RealDataController realdatacontroller = Get.put(RealDataController());
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -36,25 +35,27 @@ class RealDataContainer extends StatelessWidget {
Positioned( Positioned(
bottom: 30, bottom: 30,
left: 35, left: 35,
child: ElevatedButton( child: Obx(() => ElevatedButton(
style: ButtonStyle( style: ButtonStyle(
fixedSize: MaterialStateProperty.all(Size(200, 70)), fixedSize: MaterialStateProperty.all(Size(200, 70)),
backgroundColor: MaterialStateProperty.all( backgroundColor: MaterialStateProperty.all(
const Color.fromARGB(255, 226, 220, 220))), const Color.fromARGB(255, 226, 220, 220),
),
),
child: Text( child: Text(
realdatacontroller.isClick.value ? ' 暂停 ' : ' 开始 ', controller.isClicked.value ? ' 暂停 ' : ' 开始 ',
style: TextStyle( style: TextStyle(
fontSize: 28, fontSize: 28,
color: realdatacontroller.isClick.value color: controller.isClicked.value
? Colors.red ? Colors.red
: Colors.green), : Colors.green,
), ),
onPressed: () => { ),
realdatacontroller.isClick.value = onPressed: () {
!realdatacontroller.isClick.value, controller.isClicked.value = !controller.isClicked.value;
}, },
)),
), ),
)
], ],
), ),
); );