优化 打点删除撤回的点击效果

This commit is contained in:
mmc
2026-03-10 17:22:15 +08:00
parent 9fb3da7590
commit 302f37e100

View File

@@ -165,13 +165,22 @@ class _BottomOperationPanelState extends State<BottomOperationPanel> {
widget.onAddTap?.call(); widget.onAddTap?.call();
}, },
child: Container( child: Material(
color: Colors.transparent,
shape: const CircleBorder(),
child: InkWell(
customBorder: const CircleBorder(),
splashColor: Colors.white24,
highlightColor: Colors.white10,
child: Ink(
width: 40, width: 40,
height: 40, height: 40,
decoration: const BoxDecoration(color: Color(0xFF00C853), shape: BoxShape.circle), decoration: const BoxDecoration(color: Color(0xFF00C853), shape: BoxShape.circle),
child: const Icon(Icons.add, color: Colors.white, size: 32), child: const Icon(Icons.add, color: Colors.white, size: 32),
), ),
), ),
),
),
if (widget.initialWorkMode == WorkMode.bow) if (widget.initialWorkMode == WorkMode.bow)
DropdownButton<AreaMode>( DropdownButton<AreaMode>(
value: _areaMode, value: _areaMode,
@@ -297,20 +306,27 @@ class _BottomOperationPanelState extends State<BottomOperationPanel> {
// 构建操作按钮 // 构建操作按钮
Widget _buildActionButton(IconData icon, String label, bool isEnabled, VoidCallback onTap) { Widget _buildActionButton(IconData icon, String label, bool isEnabled, VoidCallback onTap) {
return GestureDetector( return Column(
onTap: isEnabled ? onTap : null,
child: Column(
children: [ children: [
Container( Material(
color: Colors.transparent,
shape: const CircleBorder(),
child: InkWell(
onTap: isEnabled ? onTap : null, // 关键
customBorder: const CircleBorder(),
splashColor: isEnabled ? null : Colors.transparent,
highlightColor: Colors.transparent,
child: Ink(
width: 40, width: 40,
height: 40, height: 40,
decoration: BoxDecoration(color: isEnabled ? Colors.blue : Colors.grey[300], shape: BoxShape.circle), decoration: BoxDecoration(color: isEnabled ? Colors.blue : Colors.grey[300], shape: BoxShape.circle),
child: Icon(icon, color: Colors.white), child: Icon(icon, color: isEnabled ? Colors.white : Colors.grey),
),
),
), ),
const SizedBox(height: 6), const SizedBox(height: 6),
Text(label, style: TextStyle(color: isEnabled ? Colors.black : Colors.grey)), Text(label, style: TextStyle(color: isEnabled ? Colors.black : Colors.grey)),
], ],
),
); );
} }
} }