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?
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.Changes
The main components of these changes are the
PressEvent
(enum
) and thePressEventMixWidgetState
(inherited widget
). The enum value is held byPressEventMixWidgetState
and is updated each time an onTap event occurs.Review Checklist
Additional Information (optional)
Is there any additional context or documentation that might be helpful for reviewers?