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

WIP: Add support for onTapDown and onTapUp #534

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

tilucasoli
Copy link
Collaborator

Related issue

#533

Description

This pull request introduces support for styling widgets during the Tap Down and Tap Up events by incorporating these concepts as events in the press context variant.

Style(
  $box.height(100),
  $box.width(100),
  $box.color.red(),
  $box.wrap.scale(1),
  $on.press.event(
    (e) {
      switch (e) {
        case PressEvent.onTapUp:
        case PressEvent.onTapDown:
          return Style(
            $box.color.purple(),
            $box.wrap.scale(1),
          );
        case PressEvent.idle:
          break;
      }
      return Style(
        $box.color.blue(),
      );
    },
)

Changes

The main components of these changes are the PressEvent (enum) and the PressEventMixWidgetState (inherited widget). The enum value is held by PressEventMixWidgetState and is updated each time an onTap event occurs.

Review Checklist

  • Testing: Have you tested your changes, including unit tests and integration tests for affected code?
  • Breaking Changes: Does this change introduce breaking changes affecting existing code or users?
  • Documentation Updates: Are all relevant documentation files (e.g. README, API docs) updated to reflect the changes in this PR?
  • Website Updates: Is the website containing the updates you make on documentation?

Additional Information (optional)

Is there any additional context or documentation that might be helpful for reviewers?

Copy link

vercel bot commented Nov 28, 2024

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

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
mix-docs ⬜️ Ignored (Inspect) Visit Preview Nov 29, 2024 1:11am

@github-actions github-actions bot added the mix label Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant