Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Option to allow target's default behaviour #467

Closed
pawanbangar opened this issue Aug 6, 2024 · 1 comment
Closed

Add Option to allow target's default behaviour #467

pawanbangar opened this issue Aug 6, 2024 · 1 comment

Comments

@pawanbangar
Copy link

pawanbangar commented Aug 6, 2024

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 #412
@aditya-css

@aditya-chavda
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants