import 'dart:math'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:intl/intl.dart'; import '../../service/pile/device_type.dart'; import '../../service/pile/input.dart'; import '../../service/pile/public_widget.dart'; import '../aim_point/aimpoint_page.dart'; import 'controller.dart'; class RealDataContainer extends StatelessWidget { final RealDataController controller = Get.find(); @override Widget build(BuildContext context) { final size = MediaQuery.of(context).size; double rectWidth = size.width; return Container( child: Stack( children: [ RealDataVIew(), Positioned( bottom: 120, // 根据需要调整位置 left: 5, // 根据需要调整位置 child: Container( decoration: const BoxDecoration(color: Colors.transparent), child: Stack(children: [ Card( color: Colors.transparent, elevation: 0, child: AimPointer(size: Size(250, 250)), ), ]))), Positioned( bottom: 30, left: 35, child: Obx(() => ElevatedButton( style: ButtonStyle( fixedSize: MaterialStateProperty.all(Size(200, 70)), backgroundColor: MaterialStateProperty.all( const Color.fromARGB(255, 226, 220, 220), ), ), child: Text( controller.isClicked.value ? ' 暂停 ' : ' 开始 ', style: TextStyle( fontSize: 28, color: controller.isClicked.value ? Colors.red : Colors.green, ), ), onPressed: () { controller.isClicked.value = !controller.isClicked.value; }, )), ), ], ), ); } } class RealDataVIew extends GetView { RealDataVIew({super.key}); final PlumRealDataController plumDataController = Get.find(); @override Widget build(BuildContext context) { double fontSize = 16; DeviceType deviceType = getDeviceType(context); if (deviceType == DeviceType.mobile) { fontSize = 16; } else { fontSize = 20; } return Container( clipBehavior: Clip.hardEdge, alignment: Alignment.centerLeft, // height: 130, padding: const EdgeInsets.symmetric(horizontal: 5), decoration: BoxDecoration(border: Border.all(color: Colors.black, width: 1)), child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ // Stack(children: [ // Positioned( // width: 20, // height: 20, // child: Card( // color: Colors.transparent, // elevation: 5.0, // child: // ), // ) // ]), const SizedBox( height: 20, ), Wrap( children: [ Obx(() => Text( DateFormat('yy-MM-dd HH:mm:ss').format(controller.time.value), style: const TextStyle(fontSize: 20, height: 2), )), ], ), SingleChildScrollView( child: Theme( data: ThemeData( textTheme: TextTheme( titleLarge: TextStyle( fontSize: fontSize, fontWeight: FontWeight.normal, ), )), child: Obx(() => Wrap( children: [ // Text( // '工作区域:$txt ', // style: textStyle, // ), // Text( // '工作层级:$txt ', // style: textStyle, // ), Text( '设备编号:${controller.tid.value} ', style: Theme.of(context).textTheme.titleLarge, ), Text( // '桩点名称:${controller.name.value} ', '桩点名称:${controller.name.value} ', style: Theme.of(context).textTheme.titleLarge, ), Text( // '夯沉量:${controller.sid.value} ', '桩深:${controller.sid.value} ', style: Theme.of(context).textTheme.titleLarge, ), Text( // '次:${controller.times.value} ', '垂直度:${controller.times.value} ', style: Theme.of(context).textTheme.titleLarge, ), Text( // '次:${controller.times.value} ', '电流:${controller.times.value} ', style: Theme.of(context).textTheme.titleLarge, ), Text( // '次:${controller.times.value} ', '灌注量:${controller.times.value} ', style: Theme.of(context).textTheme.titleLarge, ), ], ))), ), ]), ); } }