From 08a575ebcc9329350015bf8f9b4b19f179215247 Mon Sep 17 00:00:00 2001 From: Pawan Bangar <34831511+pawanbangar@users.noreply.github.com> Date: Wed, 7 Aug 2024 08:34:14 +0530 Subject: [PATCH] Added Test for allowTargetInteraction Disabling onTargetDoubleTap, onTargetLongPress and onTargetClick if you pass allowTargetInteraction --- lib/src/showcase.dart | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/src/showcase.dart b/lib/src/showcase.dart index 895b20f7..87785021 100644 --- a/lib/src/showcase.dart +++ b/lib/src/showcase.dart @@ -311,7 +311,9 @@ class Showcase extends StatefulWidget { assert(disposeOnTap == null || onTargetClick != null, "onTargetClick is required if you're using disposeOnTap"), assert(onBarrierClick == null || disableBarrierInteraction == false, - "can't use onBarrierClick & disableBarrierInteraction property at same time"); + "can't use onBarrierClick & disableBarrierInteraction property at same time"), + assert(allowTargetInteraction == true && (onTargetClick != null || onTargetDoubleTap !=null || onTargetLongPress!=null), + "can't use allowTargetInteraction & onTargetClick,onTargetDoubleTap,onTargetLongPress property at same time"); const Showcase.withWidget({ required this.key, @@ -366,7 +368,9 @@ class Showcase extends StatefulWidget { assert(overlayOpacity >= 0.0 && overlayOpacity <= 1.0, "overlay opacity must be between 0 and 1."), assert(onBarrierClick == null || disableBarrierInteraction == false, - "can't use onBarrierClick & disableBarrierInteraction property at same time"); + "can't use onBarrierClick & disableBarrierInteraction property at same time"), + assert(allowTargetInteraction == true && (onTargetClick != null || onTargetDoubleTap !=null || onTargetLongPress!=null), + "can't use allowTargetInteraction & onTargetClick,onTargetDoubleTap,onTargetLongPress property at same time"); @override State createState() => _ShowcaseState();