From 76c911e6972f0761b1b7b44492c9e2f9fd1aec86 Mon Sep 17 00:00:00 2001 From: Dan Cojocaru Date: Sat, 9 Jul 2022 16:06:44 +0300 Subject: [PATCH] Show delete drag target only in design mode --- lib/pages/design_component.dart | 37 +++++++++++++++++---------------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/lib/pages/design_component.dart b/lib/pages/design_component.dart index 1a3e95e..e8bf496 100644 --- a/lib/pages/design_component.dart +++ b/lib/pages/design_component.dart @@ -418,27 +418,28 @@ class DesignComponentPage extends HookWidget { // disposeController: false, backgroundColor: Theme.of(context).colorScheme.background, ), - Positioned( - bottom: 0, - right: 0, - child: MouseRegion( - hitTestBehavior: HitTestBehavior.translucent, - opaque: false, - onEnter: (_) { - deleteOnDrop.value = true; - }, - onExit: (_) { - deleteOnDrop.value = false; - }, - child: Padding( - padding: const EdgeInsets.all(16.0), - child: Icon( - Icons.delete, - color: movingWidget.value != null && deleteOnDrop.value ? Colors.red : null, + if (!isSimulating.value) + Positioned( + bottom: 0, + right: 0, + child: MouseRegion( + hitTestBehavior: HitTestBehavior.translucent, + opaque: false, + onEnter: (_) { + deleteOnDrop.value = true; + }, + onExit: (_) { + deleteOnDrop.value = false; + }, + child: Padding( + padding: const EdgeInsets.all(16.0), + child: Icon( + Icons.delete, + color: movingWidget.value != null && deleteOnDrop.value ? Colors.red : null, + ), ), ), ), - ) ], ), );