pile_nav_new/lib/pages/task/task_page.dart

203 lines
7.4 KiB
Dart
Raw Normal View History

2024-09-03 18:05:49 +08:00
import 'package:cpnav/main.dart';
2024-09-04 17:56:48 +08:00
import 'package:cpnav/pages/pile/pileGenerateCard/pileGenerate.dart';
2024-09-03 18:05:49 +08:00
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:get/get_connect/http/src/utils/utils.dart';
2024-09-04 17:56:48 +08:00
import 'package:scence_map/controllers/controller.dart';
2024-09-03 18:05:49 +08:00
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';
2024-09-04 17:56:48 +08:00
import '../pile/pileGenerateCard/pilePointTable.dart';
2024-09-03 18:05:49 +08:00
import '../pile/pileNav/view.dart';
2024-09-04 17:56:48 +08:00
final ScenceMapController mapcontroller = Get.put(ScenceMapController());
2024-09-03 18:05:49 +08:00
class TaskManagePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
final size = MediaQuery.of(context).size;
2024-09-04 17:56:48 +08:00
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)),
),
2024-09-03 18:05:49 +08:00
),
),
2024-09-04 17:56:48 +08:00
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)),
),
2024-09-03 18:05:49 +08:00
),
),
2024-09-04 17:56:48 +08:00
]),
],
),
2024-09-03 18:05:49 +08:00
),
2024-09-04 17:56:48 +08:00
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)),
)
])))
])),
));
}));
2024-09-03 18:05:49 +08:00
}
}
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;
2024-09-04 17:56:48 +08:00
return Scaffold(
2024-09-03 18:05:49 +08:00
endDrawer: Drawer(
2024-09-04 17:56:48 +08:00
width: size.width * .5,
child: PilePointTable(
pilePoints: mapcontroller.pilePoints,
onUpdate: (updatedPilePoints) {
// 这里可以处理更新后的桩点列表
print("生成桩点$updatedPilePoints,");
mapController.recordList.add(updatedPilePoints as RecordEntity);
},
),
2024-09-03 18:05:49 +08:00
),
appBar: AppBar(
title: Text('任务页面'),
actions: [
UnconstrainedBox(
child: SizedBox(
height: 30,
child: Builder(
2024-09-04 17:56:48 +08:00
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(),
2024-09-03 18:05:49 +08:00
),
2024-09-04 17:56:48 +08:00
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => PilePointTable(
// pilePoints: mapcontroller.pilePoints,
// onUpdate: (updatedPilePoints) {
// // 这里可以处理更新后的桩点列表
// print("生成桩点$updatedPilePoints,");
// },
// ),
// )),
2024-09-03 18:05:49 +08:00
),
),
),
2024-09-04 17:56:48 +08:00
),
2024-09-03 18:05:49 +08:00
UnconstrainedBox(
child: SizedBox(
height: 30,
2024-09-04 17:56:48 +08:00
child: Obx(
() => InkWell(
2024-09-03 18:05:49 +08:00
child: Icon(
Icons.settings_outlined,
size: 35,
color: appcontroller.isDarkMode.value
? Colors.white70
: const Color.fromARGB(200, 29, 28, 28),
),
2024-09-04 17:56:48 +08:00
onTap: () => pilecontroller.isPileCardVisible.value = true,
2024-09-03 18:05:49 +08:00
),
),
),
2024-09-04 17:56:48 +08:00
),
2024-09-03 18:05:49 +08:00
],
),
2024-09-04 17:56:48 +08:00
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(),
],
));
2024-09-03 18:05:49 +08:00
}
}