抽屉修改

This commit is contained in:
tanlinxing 2024-09-04 17:56:48 +08:00
parent 0006b0eefe
commit ce3cc92ad7
8 changed files with 683 additions and 379 deletions

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,21 @@
import 'package:get/get.dart';
class PileGenerController extends GetxController {
var isPileCardVisible = false.obs; //
var isRealViewCardVisible = false.obs; //
@override
void onInit() {
super.onInit();
// isRealViewCardVisible
ever(isRealViewCardVisible, (bool isVisible) {
if (isVisible) {
isPileCardVisible.value = false;
}
});
ever(isPileCardVisible, (bool isVisible) {
if (isVisible) {
isRealViewCardVisible.value = false;
}
});
}
}

View File

@ -0,0 +1,341 @@
import 'dart:math';
import 'package:cpnav/service/pile_cm.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:scence_map/controllers/controller.dart';
import 'package:scence_map/controllers/plumController.dart';
import '../../../service/pile/device_type.dart';
import '../../../service/pile/input.dart';
import '../../../service/pile/public_widget.dart';
import 'pileGenerController.dart';
final ScenceMapController mapController = Get.find<ScenceMapController>();
final PlumDataController controller = Get.find<PlumDataController>();
class PileGenerate extends StatefulWidget {
const PileGenerate({super.key});
@override
_PileGenerateState createState() => _PileGenerateState();
}
class _PileGenerateState extends State<PileGenerate> {
@override
Widget build(BuildContext context) {
double titleTextWidth = 90;
double inputLength = 120;
FocusNode xFocus = FocusNode();
FocusNode yFocus = FocusNode();
FocusNode directionFocus = FocusNode();
FocusNode pileSpaceFocus = FocusNode();
FocusNode pileWidthFocus = FocusNode();
DeviceType deviceType = getDeviceType(context);
double fontSize = 16;
if (deviceType == DeviceType.mobile) {
fontSize = 16;
} else {
fontSize = 20;
}
double centerPointX = controller.centerXY.value.dx;
double centerPointY = controller.centerXY.value.dy;
final size = MediaQuery.of(context).size;
return OrientationBuilder(builder: ((context, orientation) {
return Scaffold(
appBar: AppBar(
title: const Text("桩点生成"),
toolbarHeight: 30,
leading: IconButton(
icon: Icon(Icons.close),
onPressed: () {
setState(() {
pilecontroller.isPileCardVisible.value = false;
pilecontroller.isRealViewCardVisible.value = false;
});
},
),
),
body: SizedBox(
height: size.height,
child: Stack(
children: [
SingleChildScrollView(
child: AlignWrapWidget(
children: [
Row(
children: [
const Text('地图显示:'),
Obx(() => Switch(
value: controller.isMap.value,
onChanged: ((value) {
controller.isMap.value = !controller.isMap.value;
}))),
],
),
AlignWrapWidget(
children: [
ElevatedButton(
child: const Text("夯锤坐标"),
onPressed: () => {controller.isDirect.value = false},
),
const SizedBox(
width: 10,
),
ElevatedButton(
child: const Text("桩点坐标"),
onPressed: () => {
controller.isGenerate.value = true,
controller.checkValue.value = "checkPile",
controller.isDirect.value = false,
pilecontroller.isPileCardVisible.value = false,
}),
const SizedBox(
width: 10,
),
ElevatedButton(
child: const Text("方向设置"),
onPressed: () => {
controller.isGenerate.value = true,
controller.checkValue.value = "checkDirection",
controller.isDirect.value = true,
controller.centerXY.value =
Offset(centerPointX, centerPointY),
pilecontroller.isPileCardVisible.value = false,
}),
],
),
Row(children: [
FixedWidthTextWidget(width: titleTextWidth, text: "X:"),
inputText(
inputLength: inputLength,
value: centerPointX.toString(),
fontsize: fontSize,
focusNode: yFocus,
onChanged: (value) => value.isNotEmpty
? centerPointY = double.parse(value)
: '')
]),
Row(children: [
FixedWidthTextWidget(width: titleTextWidth, text: "Y:"),
inputText(
inputLength: inputLength,
value: centerPointY.toString(),
fontsize: fontSize,
focusNode: xFocus,
onChanged: (value) => value.isNotEmpty
? centerPointX = double.parse(value)
: '')
]),
Row(children: [
FixedWidthTextWidget(width: titleTextWidth, text: "方向(°):"),
inputText(
inputLength: inputLength,
value: controller.direction.toString(),
fontsize: fontSize,
focusNode: directionFocus,
keyboardType: 0,
onChanged: (value) {
if (value.isNotEmpty) {
controller.direction.value = double.parse(value);
// bug
controller.angle.value =
controller.direction.value * pi / 180;
}
})
]),
Row(children: [
FixedWidthTextWidget(
width: titleTextWidth + 10, text: "夯点间距(m):"),
inputText(
inputLength: inputLength - 10,
fontsize: fontSize,
value: controller.space.toString(),
focusNode: pileSpaceFocus,
onChanged: (value) => {
value.isNotEmpty
? controller.space.value = double.parse(value)
: '',
})
]),
Row(children: [
FixedWidthTextWidget(
width: titleTextWidth + 10, text: "宽度(m):"),
inputText(
inputLength: inputLength - 10,
fontsize: fontSize,
value: controller.pileWidth.toString(),
focusNode: pileWidthFocus,
onChanged: (value) => {
value.isNotEmpty
? controller.pileWidth.value =
double.parse(value)
: '',
})
]),
Row(children: [
const Icon(
Icons.tips_and_updates_outlined,
color: Colors.red,
),
Text(
controller.isPileId.value
? '选中桩点:${controller.checkName.value}'
: ' 未选中桩点',
style: TextStyle(
color: !controller.isPileId.value
? Colors.red
: Colors.black),
)
]),
],
)),
Positioned(
bottom: 10,
child: Row(
children: [
TextButton(
child: const Text('取消'),
onPressed: () {
controller.isGenerate.value = false;
controller.isDirect.value = false;
controller.isSave.value = false;
//
},
),
TextButton(
child: const Text('确定'),
onPressed: () {
//
var dx = (controller.canvasSize.width) / 2;
var dy = (controller.canvasSize.height) / 2;
var rotation = mapController.rotation.value;
for (int i = 0; i < controller.plumList.length; i++) {
Offset item = controller.plumList[i];
var dx1 = ((item.dx - dx) * cos(rotation) +
(item.dy - dy) * sin(rotation));
var dy1 = -(item.dx - dx) * sin(rotation) +
(item.dy - dy) * cos(rotation);
dx1 = double.parse(
(dx1 * 1000 / 1000).toStringAsFixed(3));
dy1 = double.parse(
(dy1 * 1000 / 1000).toStringAsFixed(3));
Offset xy = mapController.ScreenCenter2xy(dx1, dy1);
PilePoint pilePoint = PilePoint(
x: xy.dx,
y: xy.dy,
times: 0,
id: i + 1,
radius: 0.3);
mapController.pilePoints.add(pilePoint);
}
controller.isGenerate.value = false;
controller.isDirect.value = false;
controller.isSave.value = true;
controller.centerXY.value =
Offset(centerPointX, centerPointY);
},
),
],
))
],
),
),
);
}));
}
}
final PileGenerController pilecontroller = Get.put(PileGenerController());
//
class PileGenerateCard extends StatelessWidget {
const PileGenerateCard();
@override
Widget build(BuildContext context) {
final Size size = MediaQuery.of(context).size;
MediaQueryData mediaQueryData =
MediaQueryData.fromView(WidgetsBinding.instance.window); //
final orientation = mediaQueryData.orientation; //
double rectWidth = size.width;
final deviceType = getDeviceType(context);
if (orientation == Orientation.landscape) {
rectWidth = size.width / 2;
if (deviceType == DeviceType.mobile) {
rectWidth = size.height - 130;
}
} else {
rectWidth = size.height / 2;
if (deviceType == DeviceType.mobile) {
rectWidth = size.width - 5;
}
}
return Obx(() => Visibility(
visible: pilecontroller.isPileCardVisible.value,
child: Positioned(
right: 0,
top: 0,
width: rectWidth - 30,
height: rectWidth + 45,
child: Stack(children: [
Container(
decoration: const BoxDecoration(color: Colors.transparent),
child: Stack(children: [
Card(
color: Colors.transparent,
elevation: 5.0,
child: PileGenerate(),
),
]))
]))));
}
}
//
class PileGenerateCard1 extends StatelessWidget {
const PileGenerateCard1();
@override
Widget build(BuildContext context) {
final Size size = MediaQuery.of(context).size;
MediaQueryData mediaQueryData =
MediaQueryData.fromView(WidgetsBinding.instance.window); //
final orientation = mediaQueryData.orientation; //
double rectWidth = size.width;
final deviceType = getDeviceType(context);
if (orientation == Orientation.landscape) {
rectWidth = size.width / 2;
if (deviceType == DeviceType.mobile) {
rectWidth = size.height - 130;
}
} else {
rectWidth = size.height / 2;
if (deviceType == DeviceType.mobile) {
rectWidth = size.width - 5;
}
}
return Obx(() => Visibility(
visible: pilecontroller.isRealViewCardVisible.value,
child: Positioned(
right: 0,
top: 0,
width: rectWidth - 30,
height: rectWidth + 45,
child: Stack(children: [
Container(
decoration: const BoxDecoration(color: Colors.transparent),
child: Stack(children: [
Card(
color: Colors.transparent,
elevation: 5.0,
child: PileGenerate(),
),
]))
]))));
}
}

View File

@ -0,0 +1,165 @@
import 'package:flutter/material.dart';
import 'package:scence_map/controllers/controller.dart';
class PilePointTable extends StatefulWidget {
final List<PilePoint> pilePoints;
final Function(List<PilePoint>) onUpdate;
PilePointTable({required this.pilePoints, required this.onUpdate});
@override
_PilePointTableState createState() => _PilePointTableState();
}
class _PilePointTableState extends State<PilePointTable> {
List<bool> _selected = [];
@override
void initState() {
super.initState();
_selected = List<bool>.filled(widget.pilePoints.length, false);
}
void _deleteSelected() {
setState(() {
widget.pilePoints
.removeWhere((point) => _selected[widget.pilePoints.indexOf(point)]);
_selected = List<bool>.filled(widget.pilePoints.length, false);
widget.onUpdate(widget.pilePoints);
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('桩点列表'),
actions: [
IconButton(
icon: Icon(Icons.delete),
onPressed: _deleteSelected,
),
],
),
body: SingleChildScrollView(
scrollDirection: Axis.vertical,
child: Table(
border: const TableBorder(
verticalInside: BorderSide(color: Colors.grey, width: 1.0),
horizontalInside: BorderSide(color: Colors.grey, width: 1.0),
),
columnWidths: const {
0: IntrinsicColumnWidth(),
1: IntrinsicColumnWidth(),
2: IntrinsicColumnWidth(),
3: IntrinsicColumnWidth(),
},
children: [
const TableRow(
children: [
Center(child: Text('选择')),
Center(child: Text('ID')),
Center(child: Text('X')),
Center(child: Text('Y')),
],
),
...List<TableRow>.generate(
widget.pilePoints.length,
(index) => TableRow(
children: [
TableCell(
verticalAlignment: TableCellVerticalAlignment.middle,
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 12.0),
child: Checkbox(
value: _selected[index],
onChanged: (bool? value) {
setState(() {
_selected[index] = value ?? false;
});
},
),
),
),
TableCell(
verticalAlignment: TableCellVerticalAlignment.middle,
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 12.0),
child: Text(widget.pilePoints[index].id.toString()),
),
),
TableCell(
verticalAlignment: TableCellVerticalAlignment.middle,
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 12.0),
child: GestureDetector(
onTap: () => _editPilePoint(context, index, 'x'),
child:
Text(widget.pilePoints[index].x.toString()),
),
),
),
TableCell(
verticalAlignment: TableCellVerticalAlignment.middle,
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 12.0),
child: GestureDetector(
onTap: () => _editPilePoint(context, index, 'y'),
child:
Text(widget.pilePoints[index].y.toString()),
),
),
),
],
),
),
],
),
),
);
}
void _editPilePoint(BuildContext context, int index, String field) {
TextEditingController controller = TextEditingController(
text: field == 'x'
? widget.pilePoints[index].x.toString()
: widget.pilePoints[index].y.toString(),
);
showDialog(
context: context,
builder: (context) {
return AlertDialog(
title: Text('编辑桩点'),
content: TextField(
controller: controller,
keyboardType: TextInputType.number,
decoration: InputDecoration(labelText: field == 'x' ? 'X' : 'Y'),
),
actions: [
TextButton(
onPressed: () {
setState(() {
if (field == 'x') {
widget.pilePoints[index].x = double.parse(controller.text);
} else {
widget.pilePoints[index].y = double.parse(controller.text);
}
widget.onUpdate(widget.pilePoints);
});
Navigator.of(context).pop();
},
child: Text('保存'),
),
TextButton(
onPressed: () {
Navigator.of(context).pop();
},
child: Text('取消'),
),
],
);
},
);
}
}

View File

@ -107,10 +107,6 @@ class DrawDirection extends CustomPainter {
} }
} }
// if (plumList.isNotEmpty) {
// controller.plumList.value = plumList;
// // controller.update();
// }
} }
} }

View File

@ -3,6 +3,7 @@ import 'dart:math';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:scence_map/controllers/controller.dart'; import 'package:scence_map/controllers/controller.dart';
import 'package:scence_map/controllers/plumController.dart'; import 'package:scence_map/controllers/plumController.dart';
import 'package:scence_map/record_entity.dart';
import 'package:scence_map/scence_map.dart'; import 'package:scence_map/scence_map.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
@ -10,6 +11,7 @@ import 'package:get/get.dart';
import '../../../models/pilePoint/hyrecorditem.dart'; import '../../../models/pilePoint/hyrecorditem.dart';
import '../../pass_track/view.dart'; import '../../pass_track/view.dart';
import '../../task/task_page.dart'; import '../../task/task_page.dart';
import '../pileGenerateCard/pileGenerate.dart';
import 'draw_pile.dart'; import 'draw_pile.dart';
class RealView extends StatefulWidget { class RealView extends StatefulWidget {
@ -52,16 +54,16 @@ class _RealViewState extends State<RealView> {
Offset sc2xy = scenceMapController.screen2xy0(details.localPosition); Offset sc2xy = scenceMapController.screen2xy0(details.localPosition);
controller.centerXY.value = sc2xy; controller.centerXY.value = sc2xy;
HyRecordItem? checkPoint = RecordEntity? checkPoint =
scenceMapController.pointInfo(controller.centerXY.value); scenceMapController.pointInfo(controller.centerXY.value);
if (checkPoint != null) { if (checkPoint != null) {
controller.isPileId.value = true; controller.isPileId.value = true;
controller.checkName.value = checkPoint.tpId.toString(); // controller.checkName.value = checkPoint.tpId.toString();
} else { } else {
controller.isPileId.value = false; controller.isPileId.value = false;
controller.checkName.value = "未找到"; controller.checkName.value = "未找到";
} }
Scaffold.of(context).openEndDrawer();
} }
} }
@ -186,8 +188,8 @@ class _RealViewState extends State<RealView> {
), ),
child: const Icon(Icons.keyboard_return), child: const Icon(Icons.keyboard_return),
onPressed: () { onPressed: () {
Scaffold.of(context).openEndDrawer(); pilecontroller.isRealViewCardVisible.value = true;
controller.isDirect.value = false; controller.isDirect.value = true;
}, },
), ),
)); ));
@ -201,13 +203,14 @@ class _RealViewState extends State<RealView> {
// child: const ScenceMapView( // child: const ScenceMapView(
// children: [], // children: [],
// ), // ),
child:TaskPage(), // child: TaskPage(), //
// PassTrack( // PassTrack(
// date: '', // date: '',
// ) // )
)), )),
center, center,
back, back,
PileGenerateCard1()
], ],
); );
} }

View File

@ -1,232 +0,0 @@
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:scence_map/controllers/controller.dart';
import 'package:scence_map/controllers/plumController.dart';
import '../../../service/pile/device_type.dart';
import '../../../service/pile/input.dart';
import '../../../service/pile/public_widget.dart';
final ScenceMapController mapController = Get.find<ScenceMapController>();
class PileGenerate extends GetView<PlumDataController> {
const PileGenerate({super.key});
@override
Widget build(BuildContext context) {
double titleTextWidth = 90;
double inputLength = 120;
FocusNode xFocus = FocusNode();
FocusNode yFocus = FocusNode();
FocusNode directionFocus = FocusNode();
FocusNode pileSpaceFocus = FocusNode();
FocusNode pileWidthFocus = FocusNode();
DeviceType deviceType = getDeviceType(context);
double fontSize = 16;
if (deviceType == DeviceType.mobile) {
fontSize = 16;
} else {
fontSize = 20;
}
double centerPointX = controller.centerXY.value.dx;
double centerPointY = controller.centerXY.value.dy;
final size = MediaQuery.of(context).size;
return Scaffold(
appBar: AppBar(
title: const Text("桩点生成"),
toolbarHeight: 30,
),
body: SizedBox(
height: size.height,
child: Stack(
children: [
SingleChildScrollView(
child: AlignWrapWidget(
children: [
Row(
children: [
const Text('地图显示:'),
Obx(() => Switch(
value: controller.isMap.value,
onChanged: ((value) {
controller.isMap.value = !controller.isMap.value;
}))),
],
),
AlignWrapWidget(
children: [
ElevatedButton(
child: const Text("夯锤坐标"),
onPressed: () => {controller.isDirect.value = false},
),
const SizedBox(
width: 10,
),
ElevatedButton(
child: const Text("桩点坐标"),
onPressed: () => {
controller.isGenerate.value = true,
controller.checkValue.value = "checkPile",
controller.isDirect.value = false,
// controller.checkValue.value = "checkDirection",
// controller.isDirect.value = true,
// controller.centerXY.value =
// Offset(centerPointX, centerPointY),
}),
const SizedBox(
width: 10,
),
ElevatedButton(
child: const Text("方向设置"),
onPressed: () => {
controller.isGenerate.value = true,
controller.checkValue.value = "checkDirection",
controller.isDirect.value = true,
controller.centerXY.value =
Offset(centerPointX, centerPointY),
Navigator.pop(context)
}),
],
),
Row(children: [
FixedWidthTextWidget(width: titleTextWidth, text: "X:"),
inputText(
inputLength: inputLength,
value: centerPointX.toString(),
fontsize: fontSize,
focusNode: yFocus,
onChanged: (value) => value.isNotEmpty
? centerPointY = double.parse(value)
: '')
]),
Row(children: [
FixedWidthTextWidget(width: titleTextWidth, text: "Y:"),
inputText(
inputLength: inputLength,
value: centerPointY.toString(),
fontsize: fontSize,
focusNode: xFocus,
onChanged: (value) => value.isNotEmpty
? centerPointX = double.parse(value)
: '')
]),
Row(children: [
FixedWidthTextWidget(width: titleTextWidth, text: "方向(°):"),
inputText(
inputLength: inputLength,
value: controller.direction.toString(),
fontsize: fontSize,
focusNode: directionFocus,
keyboardType: 0,
onChanged: (value) {
if (value.isNotEmpty) {
controller.direction.value = double.parse(value);
// bug
controller.angle.value =
controller.direction.value * pi / 180;
}
})
]),
Row(children: [
FixedWidthTextWidget(
width: titleTextWidth + 10, text: "夯点间距(m):"),
inputText(
inputLength: inputLength - 10,
fontsize: fontSize,
value: controller.space.toString(),
focusNode: pileSpaceFocus,
onChanged: (value) => {
value.isNotEmpty
? controller.space.value = double.parse(value)
: '',
})
]),
Row(children: [
FixedWidthTextWidget(
width: titleTextWidth + 10, text: "宽度(m):"),
inputText(
inputLength: inputLength - 10,
fontsize: fontSize,
value: controller.pileWidth.toString(),
focusNode: pileWidthFocus,
onChanged: (value) => {
value.isNotEmpty
? controller.pileWidth.value =
double.parse(value)
: '',
})
]),
Row(children: [
const Icon(
Icons.tips_and_updates_outlined,
color: Colors.red,
),
Text(
controller.isPileId.value
? '选中桩点:${controller.checkName.value}'
: ' 未选中桩点',
style: TextStyle(
color: !controller.isPileId.value
? Colors.red
: Colors.black),
)
]),
],
)),
Positioned(
bottom: 10,
child: Row(
children: [
TextButton(
child: const Text('取消'),
onPressed: () {
controller.isGenerate.value = false;
controller.isDirect.value = false;
controller.isSave.value = false;
//
Navigator.of(context).pop();
},
),
TextButton(
child: const Text('确定'),
onPressed: () {
//
var dx = (controller.canvasSize.width) / 2;
var dy = (controller.canvasSize.height) / 2;
var rotation = mapController.rotation.value;
for (int i = 0; i < controller.plumList.length; i++) {
Offset item = controller.plumList[i];
var dx1 = (item.dx - dx) * cos(rotation) +
(item.dy - dy) * sin(rotation);
var dy1 = -(item.dx - dx) * sin(rotation) +
(item.dy - dy) * cos(rotation);
Offset xy = mapController.ScreenCenter2xy(dx1, dy1);
PilePoint pilePoint = PilePoint(
x: xy.dx,
y: xy.dy,
state: 0,
id: i + 1,
radius: 0.3);
mapController.pilePoints.add(pilePoint);
}
controller.isGenerate.value = false;
controller.isDirect.value = false;
controller.isSave.value = true;
controller.centerXY.value =
Offset(centerPointX, centerPointY);
Navigator.of(context).pop();
},
),
],
))
],
),
),
);
}
}

View File

@ -1,20 +1,24 @@
import 'package:cpnav/main.dart'; import 'package:cpnav/main.dart';
import 'package:cpnav/pages/pile/rightDra/pileGenerate.dart'; import 'package:cpnav/pages/pile/pileGenerateCard/pileGenerate.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:get/get_connect/http/src/utils/utils.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/record_entity.dart';
import 'package:scence_map/scence_map.dart'; import 'package:scence_map/scence_map.dart';
import '../aim_point/aimpoint_page.dart'; import '../aim_point/aimpoint_page.dart';
import '../pass_track/controller.dart'; import '../pass_track/controller.dart';
import '../pass_track/view.dart'; import '../pass_track/view.dart';
import '../pile/pileGenerateCard/pilePointTable.dart';
import '../pile/pileNav/view.dart'; import '../pile/pileNav/view.dart';
final ScenceMapController mapcontroller = Get.put(ScenceMapController());
class TaskManagePage extends StatelessWidget { class TaskManagePage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final size = MediaQuery.of(context).size; final size = MediaQuery.of(context).size;
return OrientationBuilder(builder: ((context, orientation) {
return Center( return Center(
child: Container( child: Container(
width: size.width * 0.8, width: size.width * 0.8,
@ -48,7 +52,8 @@ class TaskManagePage extends StatelessWidget {
// prefixIcon: Icon(Icons.email), // prefixIcon: Icon(Icons.email),
border: InputBorder.none, //线 border: InputBorder.none, //线
labelStyle: TextStyle( labelStyle: TextStyle(
fontSize: 16, color: Color.fromARGB(164, 75, 73, 73)), fontSize: 16,
color: Color.fromARGB(164, 75, 73, 73)),
), ),
), ),
), ),
@ -62,7 +67,8 @@ class TaskManagePage extends StatelessWidget {
// prefixIcon: Icon(Icons.email), // prefixIcon: Icon(Icons.email),
border: InputBorder.none, //线 border: InputBorder.none, //线
labelStyle: TextStyle( labelStyle: TextStyle(
fontSize: 16, color: Color.fromARGB(164, 75, 73, 73)), fontSize: 16,
color: Color.fromARGB(164, 75, 73, 73)),
), ),
), ),
), ),
@ -94,6 +100,7 @@ class TaskManagePage extends StatelessWidget {
]))) ])))
])), ])),
)); ));
}));
} }
} }
@ -107,86 +114,89 @@ class TaskPage extends StatelessWidget {
MediaQueryData.fromView(WidgetsBinding.instance.window); // MediaQueryData.fromView(WidgetsBinding.instance.window); //
final orientation = mediaQueryData.orientation; // final orientation = mediaQueryData.orientation; //
bool isPortrait = Orientation.portrait == orientation ? true : false; bool isPortrait = Orientation.portrait == orientation ? true : false;
List<Widget> children = [
Expanded( return Scaffold(
child: ScenceMapView( 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: [], children: [],
onUpdate: (Offset center, double scale, double rotation) { onUpdate: (Offset center, double scale, double rotation) {
print("center:$center scale:$scale rotation:$rotation"); print("center:$center scale:$scale rotation:$rotation");
}, },
forGroundPainter: BorderPainter(controller), forGroundPainter: BorderPainter(controller),
onUpdatePilePoint: onUpdatePilePoint: (RecordEntity? selectedPilePoint, double scale,
(RecordEntity? selectedPilePoint, double scale, double rotation) { double rotation) {
print( print(
"selectedPilePoint:$selectedPilePoint scale:$scale rotation:$rotation"); "selectedPilePoint:$selectedPilePoint scale:$scale rotation:$rotation");
}, },
), ),
), // ),
]; if (pilecontroller.isPileCardVisible.value) PileGenerateCard(),
if (isPortrait) {
return Scaffold(
endDrawer: Drawer(
width: size.width * .8,
child: const PileGenerate(),
),
appBar: AppBar(
title: Text('任务页面'),
actions: [
UnconstrainedBox(
child: SizedBox(
height: 30,
child: Builder(
builder: (context) => InkWell(
child: Icon(
Icons.settings_outlined,
size: 35,
color: appcontroller.isDarkMode.value
? Colors.white70
: const Color.fromARGB(200, 29, 28, 28),
),
onTap: () => Scaffold.of(context).openEndDrawer(),
),
),
),
)
], ],
), ));
body: Column(
children: children,
),
);
} else {
return Scaffold(
endDrawer: Drawer(
width: size.width * .8,
child: const PileGenerate(),
),
appBar: AppBar(
title: Text('任务页面'),
actions: [
UnconstrainedBox(
child: SizedBox(
height: 30,
child: Builder(
builder: (context) => InkWell(
child: Icon(
Icons.settings_outlined,
size: 35,
color: appcontroller.isDarkMode.value
? Colors.white70
: const Color.fromARGB(200, 29, 28, 28),
),
onTap: () => Scaffold.of(context).openEndDrawer(),
),
),
),
)
],
),
body: Row(
children: children,
),
);
}
} }
} }