SimformSolutionsPvtLtd / flutter_showcaseview

Flutter plugin that allows you to showcase your features on flutter application. 👌🔝🎉
https://pub.dev/packages/showcaseview
MIT License
1.48k stars 433 forks source link

Add Option to allow target's default behaviour #467

Closed pawanbangar closed 6 days ago

pawanbangar commented 1 month ago

Is your feature request related to a problem? Please describe. I am focusing showcaseview on column which has 5 radio button, i want user to select one of them, but i am not able to select as i can't allow target area to clickable

Describe the solution you'd like Inside lib/src /showcase.dart

If we add option to change behavior (HitTestBehavior.translucent) It will be helpoful

 Widget targetWidgetContent() {
    return GestureDetector(
      onTap: onTap,
      onLongPress: onLongPress,
      onDoubleTap: onDoubleTap,
      behavior: HitTestBehavior.translucent,
      child: Container(
        height: size.height,
        width: size.width,
        margin: targetPadding,
        decoration: ShapeDecoration(
          shape: radius != null
              ? RoundedRectangleBorder(borderRadius: radius!)
              : shapeBorder,
        ),
      ),
    );
  }

Describe alternatives you've considered I don't find alternative as we can click on target if and only if target is normal container which can i have only one clickable element.

Additional context

Screenshot 2024-08-06 at 7 45 21 PM

i feel this is happening because of this fixed PR https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/pull/412 @aditya-css

aditya-chavda commented 6 days ago

Hi @pawanbangar, You can allow the target area to be clickable by passing disableDefaultTargetGestures as true.

Here's a small example based on your provided description that uses Column having 2 Radio as its children but allows the Radio widget detect taps.

Showcase(
  key: _one,
  description: 'Tap to see menu options',
  disableDefaultTargetGestures: true,
  child: Column(
    children: [
      Radio(
        value: false,
        groupValue: false,
        toggleable: true,
        onChanged: (value) {
          print('first');
        },
      ),
      Radio(
        value: true,
        groupValue: true,
        toggleable: true,
        onChanged: (value) {
          print('second');
        },
      ),
    ],
  ),
),

Please feel free to ping me with small reproducible code if you face difficulties achieving what you desire.