保存按钮显示逻辑 自定义模式 十字准星的打点 、保存和 点击后的显示
This commit is contained in:
@@ -9,6 +9,7 @@ class BottomOperationPanel extends StatefulWidget {
|
||||
final AreaMode initialAreaMode;
|
||||
// 新增:外部控制初始选中的标签(默认地块)
|
||||
final String initialSelectedTab;
|
||||
final WorkMode initialWorkMode;
|
||||
// 回调函数:向外部传递事件
|
||||
final VoidCallback onComplete; // 完成按钮点击回调
|
||||
final ValueChanged<RobotMode>? onRobotModeChanged; // 机器人模式变更回调
|
||||
@@ -29,6 +30,7 @@ class BottomOperationPanel extends StatefulWidget {
|
||||
this.initialRobotMode = RobotMode.point,
|
||||
this.initialAreaMode = AreaMode.work,
|
||||
this.initialSelectedTab = '地块', // 默认选中地块
|
||||
this.initialWorkMode = WorkMode.bow,
|
||||
required this.onComplete, // 完成按钮必须传
|
||||
this.onRobotModeChanged,
|
||||
this.onAreaModeChanged,
|
||||
@@ -166,19 +168,20 @@ class _BottomOperationPanelState extends State<BottomOperationPanel> {
|
||||
child: const Icon(Icons.add, color: Colors.white, size: 32),
|
||||
),
|
||||
),
|
||||
DropdownButton<AreaMode>(
|
||||
value: _areaMode,
|
||||
items: const [
|
||||
DropdownMenuItem(value: AreaMode.work, child: Text("作业区域")),
|
||||
DropdownMenuItem(value: AreaMode.obstacle, child: Text("障碍区域")),
|
||||
],
|
||||
onChanged: (v) {
|
||||
if (v != null) {
|
||||
setState(() => _areaMode = v);
|
||||
widget.onAreaModeChanged?.call(v);
|
||||
}
|
||||
},
|
||||
),
|
||||
if (widget.initialWorkMode == WorkMode.bow)
|
||||
DropdownButton<AreaMode>(
|
||||
value: _areaMode,
|
||||
items: const [
|
||||
DropdownMenuItem(value: AreaMode.work, child: Text("作业区域")),
|
||||
DropdownMenuItem(value: AreaMode.obstacle, child: Text("障碍区域")),
|
||||
],
|
||||
onChanged: (v) {
|
||||
if (v != null) {
|
||||
setState(() => _areaMode = v);
|
||||
widget.onAreaModeChanged?.call(v);
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
|
||||
Reference in New Issue
Block a user