Skip to content

Commit

Permalink
Added Test for allowTargetInteraction
Browse files Browse the repository at this point in the history
Disabling onTargetDoubleTap, onTargetLongPress and onTargetClick if you pass allowTargetInteraction
  • Loading branch information
pawanbangar authored Aug 7, 2024
1 parent ff696b9 commit 08a575e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/src/showcase.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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<Showcase> createState() => _ShowcaseState();
Expand Down

0 comments on commit 08a575e

Please sign in to comment.