import 'package:cpnav/main.dart'; import 'package:cpnav/pages/pile/pileGenerateCard/pileGenerate.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:get/get_connect/http/src/utils/utils.dart'; import 'package:scence_map/controllers/controller.dart'; import 'package:scence_map/record_entity.dart'; import 'package:scence_map/scence_map.dart'; import '../aim_point/aimpoint_page.dart'; import '../pass_track/controller.dart'; import '../pass_track/view.dart'; import '../pile/pileGenerateCard/pilePointTable.dart'; import '../pile/pileNav/view.dart'; final ScenceMapController mapcontroller = Get.put(ScenceMapController()); class TaskManagePage extends StatelessWidget { @override Widget build(BuildContext context) { final size = MediaQuery.of(context).size; return OrientationBuilder(builder: ((context, orientation) { return Center( child: Container( width: size.width * 0.8, height: size.height * 0.18, decoration: BoxDecoration( border: Border.all(color: Colors.black), borderRadius: BorderRadius.circular(10), ), child: SingleChildScrollView( child: Row(children: [ SizedBox(width: 16), Icon(Icons.task, size: 50, color: Color.fromARGB(164, 75, 73, 73)), SizedBox(width: 16), Container( width: size.width * 0.4, child: const Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox(height: 5), Text( '任务', style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold), ), Row(children: [ Expanded( child: TextField( keyboardType: TextInputType.emailAddress, decoration: InputDecoration( labelText: "任务:", hintText: "", // prefixIcon: Icon(Icons.email), border: InputBorder.none, //隐藏下划线 labelStyle: TextStyle( fontSize: 16, color: Color.fromARGB(164, 75, 73, 73)), ), ), ), SizedBox(width: 5), Expanded( child: TextField( keyboardType: TextInputType.emailAddress, decoration: InputDecoration( labelText: "桩点数:", hintText: "0", // prefixIcon: Icon(Icons.email), border: InputBorder.none, //隐藏下划线 labelStyle: TextStyle( fontSize: 16, color: Color.fromARGB(164, 75, 73, 73)), ), ), ), ]), ], ), ), SizedBox(width: 150), Container( alignment: Alignment.centerLeft, child: Container( child: Row(children: [ const Text( '编辑', style: TextStyle( fontSize: 14, color: Color.fromARGB(164, 75, 73, 73)), ), SizedBox(width: 12), InkWell( onTap: () { Navigator.push( context, MaterialPageRoute(builder: (context) => RealView()), ); }, child: const Icon(Icons.arrow_forward_ios, size: 30, color: Color.fromARGB(164, 75, 73, 73)), ) ]))) ])), )); })); } } final controller = Get.put(PassTrackController("TEST", "pile_cm")); class TaskPage extends StatelessWidget { @override Widget build(BuildContext context) { final size = MediaQuery.of(context).size; MediaQueryData mediaQueryData = MediaQueryData.fromView(WidgetsBinding.instance.window); //获取当前屏幕信息 final orientation = mediaQueryData.orientation; //获得设备方向 bool isPortrait = Orientation.portrait == orientation ? true : false; return Scaffold( endDrawer: Drawer( width: size.width * .5, child: PilePointTable( pilePoints: mapcontroller.pilePoints, onUpdate: (updatedPilePoints) { // 这里可以处理更新后的桩点列表 print("生成桩点$updatedPilePoints,"); mapController.recordList.add(updatedPilePoints as RecordEntity); }, ), ), appBar: AppBar( title: Text('任务页面'), actions: [ UnconstrainedBox( child: SizedBox( height: 30, child: Builder( builder: (context) => Obx( () => InkWell( child: Icon( Icons.close, size: 35, color: appcontroller.isDarkMode.value ? Colors.white70 : const Color.fromARGB(200, 29, 28, 28), ), onTap: () => Scaffold.of(context).openEndDrawer(), ), // Navigator.push( // context, // MaterialPageRoute( // builder: (context) => PilePointTable( // pilePoints: mapcontroller.pilePoints, // onUpdate: (updatedPilePoints) { // // 这里可以处理更新后的桩点列表 // print("生成桩点$updatedPilePoints,"); // }, // ), // )), ), ), ), ), UnconstrainedBox( child: SizedBox( height: 30, child: Obx( () => InkWell( child: Icon( Icons.settings_outlined, size: 35, color: appcontroller.isDarkMode.value ? Colors.white70 : const Color.fromARGB(200, 29, 28, 28), ), onTap: () => pilecontroller.isPileCardVisible.value = true, ), ), ), ), ], ), body: Stack( children: [ ScenceMapView( children: [], onUpdate: (Offset center, double scale, double rotation) { print("center:$center scale:$scale rotation:$rotation"); }, forGroundPainter: BorderPainter(controller), onUpdatePilePoint: (RecordEntity? selectedPilePoint, double scale, double rotation) { print( "selectedPilePoint:$selectedPilePoint scale:$scale rotation:$rotation"); }, ), // ), if (pilecontroller.isPileCardVisible.value) PileGenerateCard(), ], )); } }