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 disabled property in PressableBox #183

Merged
merged 4 commits into from
Jan 30, 2024
Merged

Add disabled property in PressableBox #183

merged 4 commits into from
Jan 30, 2024

Conversation

tilucasoli
Copy link
Collaborator

@tilucasoli tilucasoli commented Jan 29, 2024

Issue ticket number

#175

Describe your changes

  • Add a new attribute to PressableBox, disabled;
  • Fix disabled feature in Pressable Widget
  • Add more test cases

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist before requesting a review

  • I have performed a self-review of my code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

Copy link

vercel bot commented Jan 29, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
mix-docs ⬜️ Ignored (Inspect) Visit Preview Jan 30, 2024 2:04am

@tilucasoli tilucasoli linked an issue Jan 29, 2024 that may be closed by this pull request
@tilucasoli tilucasoli requested a review from leoafarias January 29, 2024 19:59
lib/src/widgets/pressable/pressable_widget.dart Outdated Show resolved Hide resolved
@@ -157,35 +160,48 @@ class PressableWidgetState extends State<Pressable> {
button: true,
focusable: onEnabled && _node.canRequestFocus,
focused: _node.hasFocus,
child: GestureDetector(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the disabled should behave only for the onTap behavior, we also should not modify the element in the tree through the function returning a widget.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll change the function. However, about the disabled state only affects onTap. Are you sure? In my opinion when disabled is true, all actions involving the Pressable should be deactivated.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tilucasoli makes sense!

@tilucasoli tilucasoli requested a review from leoafarias January 30, 2024 13:44
Copy link
Member

@leoafarias leoafarias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@leoafarias leoafarias merged commit bcee2f4 into main Jan 30, 2024
4 checks passed
@leoafarias leoafarias deleted the feat/issue-175 branch January 30, 2024 18:25
@tilucasoli tilucasoli changed the title Feat/issue 175 Add disabled property in PressableBox Jan 31, 2024
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 this pull request may close these issues.

Add ability to set PressableBox to disabled
2 participants