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

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

View File

@@ -165,11 +165,20 @@ class _BottomOperationPanelState extends State<BottomOperationPanel> {
widget.onAddTap?.call(); widget.onAddTap?.call();
}, },
child: Container( child: Material(
width: 40, color: Colors.transparent,
height: 40, shape: const CircleBorder(),
decoration: const BoxDecoration(color: Color(0xFF00C853), shape: BoxShape.circle), child: InkWell(
child: const Icon(Icons.add, color: Colors.white, size: 32), customBorder: const CircleBorder(),
splashColor: Colors.white24,
highlightColor: Colors.white10,
child: Ink(
width: 40,
height: 40,
decoration: const BoxDecoration(color: Color(0xFF00C853), shape: BoxShape.circle),
child: const Icon(Icons.add, color: Colors.white, size: 32),
),
),
), ),
), ),
if (widget.initialWorkMode == WorkMode.bow) if (widget.initialWorkMode == WorkMode.bow)
@@ -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, children: [
child: Column( Material(
children: [ color: Colors.transparent,
Container( shape: const CircleBorder(),
width: 40, child: InkWell(
height: 40, onTap: isEnabled ? onTap : null, // 关键
decoration: BoxDecoration(color: isEnabled ? Colors.blue : Colors.grey[300], shape: BoxShape.circle), customBorder: const CircleBorder(),
child: Icon(icon, color: Colors.white), splashColor: isEnabled ? null : Colors.transparent,
highlightColor: Colors.transparent,
child: Ink(
width: 40,
height: 40,
decoration: BoxDecoration(color: isEnabled ? Colors.blue : Colors.grey[300], shape: BoxShape.circle),
child: Icon(icon, color: isEnabled ? Colors.white : Colors.grey),
),
), ),
const SizedBox(height: 6), ),
Text(label, style: TextStyle(color: isEnabled ? Colors.black : Colors.grey)), const SizedBox(height: 6),
], Text(label, style: TextStyle(color: isEnabled ? Colors.black : Colors.grey)),
), ],
); );
} }
} }