cpnav/lib/pages/pass_track/bottomMenu.dart
2024-08-19 18:31:59 +08:00

438 lines
19 KiB
Dart

import 'package:cpnav/pages/pass_track/view.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
class BottomMenu extends StatefulWidget {
@override
_BottomMenuState createState() => _BottomMenuState();
}
class _BottomMenuState extends State<BottomMenu> {
int _selectedIndex = -1;
void _temporarilySelectContainer(int index) {
setState(() {
_selectedIndex = index;
});
Future.delayed(Duration(milliseconds: 200), () {
setState(() {
_selectedIndex = -1;
});
});
}
@override
Widget build(BuildContext context) {
var isPortrait = MediaQuery.of(context).orientation == Orientation.portrait;
return isPortrait
? Positioned(
right: 10,
bottom: 130,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Container(
width: 36,
decoration: BoxDecoration(
color: Colors.transparent, // 设置背景为透明
border: Border.all(
color: Color.fromARGB(255, 54, 52, 52),
width: 1.0, // 设置边框宽度
),
borderRadius: BorderRadius.circular(5.0), // 可选:设置圆角边框
),
child: Column(children: [
Container(
width: 30,
height: 30,
decoration: BoxDecoration(
color: Colors.green, // 设置背景颜色为绿色
border: Border.all(
color: Colors.white, // 设置边框颜色为白色
),
borderRadius: BorderRadius.circular(5.0), // 可选:设置圆角边框
),
child: InkWell(
child: const Icon(
Icons.article,
color: Colors.white,
),
onTap: () {
mapcontroller.scale = 1.0;
mapcontroller.rotation.value = 0.0;
mapcontroller.updateCount.value++;
// onUpdate?.call(
// mapcontroller.centerXY, 1.0, 0.0);
// sight.reset();
},
),
),
Container(
width: 30,
height: 30,
decoration: BoxDecoration(
color: Colors.green, // 设置背景颜色为绿色
border: Border.all(
color: Colors.white, // 设置边框颜色为白色
),
borderRadius: BorderRadius.circular(5.0), // 可选:设置圆角边框
),
child: InkWell(
child: const Icon(
Icons.speed,
color: Colors.white,
),
onTap: () {
mapcontroller.scale = 1.0;
mapcontroller.rotation.value = 0.0;
mapcontroller.updateCount.value++;
// onUpdate?.call(
// mapcontroller.centerXY, 1.0, 0.0);
// sight.reset();
},
),
),
Container(
width: 30,
height: 30,
decoration: BoxDecoration(
color: Colors.green, // 设置背景颜色为绿色
border: Border.all(
color: Colors.white, // 设置边框颜色为白色
),
borderRadius: BorderRadius.circular(5.0), // 可选:设置圆角边框
),
child: InkWell(
child: const Icon(
Icons.thermostat,
color: Colors.white,
),
onTap: () {
mapcontroller.scale = 1.0;
mapcontroller.rotation.value = 0.0;
mapcontroller.updateCount.value++;
// onUpdate?.call(
// mapcontroller.centerXY, 1.0, 0.0);
// sight.reset();
},
),
),
Container(
width: 30,
height: 30,
decoration: BoxDecoration(
color: Colors.green, // 设置背景颜色为绿色
border: Border.all(
color: Colors.white, // 设置边框颜色为白色
width: 2.0, // 设置边框宽度
),
borderRadius: BorderRadius.circular(5.0), // 可选:设置圆角边框
),
child: InkWell(
child: const Icon(
Icons.zoom_in,
color: Colors.white,
),
onTap: () {
mapcontroller.scale = 1.0;
mapcontroller.rotation.value = 0.0;
mapcontroller.updateCount.value++;
// onUpdate?.call(
// mapcontroller.centerXY, 1.0, 0.0);
// sight.reset();
},
),
),
Container(
width: 30,
height: 30,
decoration: BoxDecoration(
color: Colors.green, // 设置背景颜色为绿色
border: Border.all(
color: Colors.white, // 设置边框颜色为白色
width: 2.0, // 设置边框宽度
),
borderRadius: BorderRadius.circular(5.0), // 可选:设置圆角边框
),
child: InkWell(
child: const Icon(
Icons.zoom_out,
color: Colors.white,
),
onTap: () {
mapcontroller.scale = 1.0;
mapcontroller.rotation.value = 0.0;
mapcontroller.updateCount.value++;
// onUpdate?.call(
// mapcontroller.centerXY, 1.0, 0.0);
// sight.reset();
},
),
),
Container(
width: 30,
height: 30,
decoration: BoxDecoration(
color: Colors.green, // 设置背景颜色为绿色
border: Border.all(
color: Colors.white, // 设置边框颜色为白色
),
borderRadius: BorderRadius.circular(5.0), // 可选:设置圆角边框
),
child: InkWell(
child: const Icon(
Icons.refresh,
color: Colors.white,
),
onTap: () {
mapcontroller.scale = 1.0;
mapcontroller.rotation.value = 0.0;
mapcontroller.updateCount.value++;
// onUpdate?.call(
// mapcontroller.centerXY, 1.0, 0.0);
// sight.reset();
},
),
),
Container(
width: 30,
height: 30,
decoration: BoxDecoration(
color: Colors.green, // 设置背景颜色为绿色
border: Border.all(
color: Colors.white, // 设置边框颜色为白色
),
borderRadius: BorderRadius.circular(5.0), // 可选:设置圆角边框
),
child: InkWell(
child: const Icon(
Icons.place,
color: Colors.white,
),
onTap: () {
mapcontroller.scale = 1.0;
mapcontroller.rotation.value = 0.0;
mapcontroller.updateCount.value++;
// onUpdate?.call(
// mapcontroller.centerXY, 1.0, 0.0);
// sight.reset();
},
),
),
]),
),
],
))
: Positioned(
right: 10,
bottom: 15,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Container(
height: 36,
decoration: BoxDecoration(
color: Colors.transparent, // 设置背景为透明
border: Border.all(
color: Color.fromARGB(255, 54, 52, 52),
width: 1.0, // 设置边框宽度
),
borderRadius: BorderRadius.circular(5.0), // 可选:设置圆角边框
),
child: Center(
// 使用 Center 小部件将子容器居中
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Container(
width: 30,
height: 30,
decoration: BoxDecoration(
color: Colors.green, // 设置背景颜色为绿色
border: Border.all(
color: Colors.white, // 设置边框颜色为白色
),
borderRadius:
BorderRadius.circular(5.0), // 可选:设置圆角边框
),
child: InkWell(
child: const Icon(
Icons.article,
color: Colors.white,
),
onTap: () {
mapcontroller.scale = 1.0;
mapcontroller.rotation.value = 0.0;
mapcontroller.updateCount.value++;
// onUpdate?.call(
// mapcontroller.centerXY, 1.0, 0.0);
// sight.reset();
},
),
),
Container(
width: 30,
height: 30,
decoration: BoxDecoration(
color: Colors.green, // 设置背景颜色为绿色
border: Border.all(
color: Colors.white, // 设置边框颜色为白色
),
borderRadius:
BorderRadius.circular(5.0), // 可选:设置圆角边框
),
child: InkWell(
child: const Icon(
Icons.speed,
color: Colors.white,
),
onTap: () {
mapcontroller.scale = 1.0;
mapcontroller.rotation.value = 0.0;
mapcontroller.updateCount.value++;
// onUpdate?.call(
// mapcontroller.centerXY, 1.0, 0.0);
// sight.reset();
},
),
),
Container(
width: 30,
height: 30,
decoration: BoxDecoration(
color: Colors.green, // 设置背景颜色为绿色
border: Border.all(
color: Colors.white, // 设置边框颜色为白色
),
borderRadius:
BorderRadius.circular(5.0), // 可选:设置圆角边框
),
child: InkWell(
child: const Icon(
Icons.thermostat,
color: Colors.white,
),
onTap: () {
mapcontroller.scale = 1.0;
mapcontroller.rotation.value = 0.0;
mapcontroller.updateCount.value++;
// onUpdate?.call(
// mapcontroller.centerXY, 1.0, 0.0);
// sight.reset();
},
),
),
Container(
width: 30,
height: 30,
decoration: BoxDecoration(
color: Colors.green, // 设置背景颜色为绿色
border: Border.all(
color: Colors.white, // 设置边框颜色为白色
width: 2.0, // 设置边框宽度
),
borderRadius:
BorderRadius.circular(5.0), // 可选:设置圆角边框
),
child: InkWell(
child: const Icon(
Icons.zoom_in,
color: Colors.white,
),
onTap: () {
mapcontroller.scale = 1.0;
mapcontroller.rotation.value = 0.0;
mapcontroller.updateCount.value++;
// onUpdate?.call(
// mapcontroller.centerXY, 1.0, 0.0);
// sight.reset();
},
),
),
Container(
width: 30,
height: 30,
decoration: BoxDecoration(
color: Colors.green, // 设置背景颜色为绿色
border: Border.all(
color: Colors.white, // 设置边框颜色为白色
width: 2.0, // 设置边框宽度
),
borderRadius:
BorderRadius.circular(5.0), // 可选:设置圆角边框
),
child: InkWell(
child: const Icon(
Icons.zoom_out,
color: Colors.white,
),
onTap: () {
mapcontroller.scale = 1.0;
mapcontroller.rotation.value = 0.0;
mapcontroller.updateCount.value++;
// onUpdate?.call(
// mapcontroller.centerXY, 1.0, 0.0);
// sight.reset();
},
),
),
Container(
width: 30,
height: 30,
decoration: BoxDecoration(
color: Colors.green, // 设置背景颜色为绿色
border: Border.all(
color: Colors.white, // 设置边框颜色为白色
),
borderRadius:
BorderRadius.circular(5.0), // 可选:设置圆角边框
),
child: InkWell(
child: const Icon(
Icons.refresh,
color: Colors.white,
),
onTap: () {
mapcontroller.scale = 1.0;
mapcontroller.rotation.value = 0.0;
mapcontroller.updateCount.value++;
// onUpdate?.call(
// mapcontroller.centerXY, 1.0, 0.0);
// sight.reset();
},
),
),
Container(
width: 30,
height: 30,
decoration: BoxDecoration(
color: Colors.green, // 设置背景颜色为绿色
border: Border.all(
color: Colors.white, // 设置边框颜色为白色
),
borderRadius:
BorderRadius.circular(5.0), // 可选:设置圆角边框
),
child: InkWell(
child: const Icon(
Icons.place,
color: Colors.white,
),
onTap: () {
mapcontroller.scale = 1.0;
mapcontroller.rotation.value = 0.0;
mapcontroller.updateCount.value++;
// onUpdate?.call(
// mapcontroller.centerXY, 1.0, 0.0);
// sight.reset();
},
),
),
],
),
),
),
],
));
}
}