|
|
|
@ -33,21 +33,6 @@ class _MapPageState extends State<MapPage> {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget _buildImage(String imagePath, double height, double verticalOffset) {
|
|
|
|
|
return Center(
|
|
|
|
|
child: SizedBox(
|
|
|
|
|
height: height,
|
|
|
|
|
child: Transform.translate(
|
|
|
|
|
offset: Offset(0, verticalOffset),
|
|
|
|
|
child: Transform.scale(
|
|
|
|
|
scale: 0.95,
|
|
|
|
|
child: Image.asset(imagePath),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return Scaffold(
|
|
|
|
@ -62,32 +47,68 @@ class _MapPageState extends State<MapPage> {
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
|
|
|
|
children: [
|
|
|
|
|
ElevatedButton(
|
|
|
|
|
style: ElevatedButton.styleFrom(
|
|
|
|
|
backgroundColor: Colors.green,
|
|
|
|
|
padding: EdgeInsets.all(16),
|
|
|
|
|
),
|
|
|
|
|
onPressed: previousFloor,
|
|
|
|
|
child: Text(
|
|
|
|
|
'切换到上一楼层',
|
|
|
|
|
style: TextStyle(fontSize: 16),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
ElevatedButton(
|
|
|
|
|
style: ElevatedButton.styleFrom(
|
|
|
|
|
backgroundColor: Colors.green,
|
|
|
|
|
padding: EdgeInsets.all(16),
|
|
|
|
|
Column(
|
|
|
|
|
children: [
|
|
|
|
|
_buildCircularButton(previousFloor, Icons.arrow_back), // 上一楼层按钮
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.only(bottom: 10), // 添加底部内边距
|
|
|
|
|
child: Text('上一楼层', style: TextStyle(fontSize: 16)),
|
|
|
|
|
),
|
|
|
|
|
onPressed: nextFloor,
|
|
|
|
|
child: Text(
|
|
|
|
|
'切换到下一楼层',
|
|
|
|
|
style: TextStyle(fontSize: 16),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Column(
|
|
|
|
|
children: [
|
|
|
|
|
_buildCircularButton(nextFloor, Icons.arrow_forward), // 下一楼层按钮
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.only(bottom: 10), // 添加底部内边距
|
|
|
|
|
child: Text('下一楼层', style: TextStyle(fontSize: 16)),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget _buildImage(String imagePath, double height, double verticalOffset) {
|
|
|
|
|
return Center(
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: EdgeInsets.only(bottom: 30), // 添加底部内边距
|
|
|
|
|
child: SizedBox(
|
|
|
|
|
height: height,
|
|
|
|
|
child: Transform.translate(
|
|
|
|
|
offset: Offset(0, verticalOffset),
|
|
|
|
|
child: Transform.scale(
|
|
|
|
|
scale: 0.95,
|
|
|
|
|
child: Image.asset(imagePath),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget _buildCircularButton(void Function() onPressed, IconData iconData) {
|
|
|
|
|
return GestureDetector(
|
|
|
|
|
onTap: onPressed,
|
|
|
|
|
child: Container(
|
|
|
|
|
width: 50,
|
|
|
|
|
height: 50,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Colors.green,
|
|
|
|
|
shape: BoxShape.circle,
|
|
|
|
|
),
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Icon(
|
|
|
|
|
iconData,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
size: 30,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|