193 lines
6.3 KiB
Dart
193 lines
6.3 KiB
Dart
|
import 'package:cpnav/main.dart';
|
||
|
import 'package:cpnav/pages/pile/rightDra/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/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/pileNav/view.dart';
|
||
|
|
||
|
class TaskManagePage extends StatelessWidget {
|
||
|
@override
|
||
|
Widget build(BuildContext context) {
|
||
|
final size = MediaQuery.of(context).size;
|
||
|
|
||
|
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;
|
||
|
List<Widget> children = [
|
||
|
Expanded(
|
||
|
child: 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 (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,
|
||
|
),
|
||
|
);
|
||
|
}
|
||
|
}
|
||
|
}
|