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

Feature: Enhance Compose Modifier with Conditional Application #127

Merged
merged 1 commit into from
Oct 4, 2023

Conversation

teogor
Copy link
Owner

@teogor teogor commented Oct 4, 2023

This pull request introduces an enhancement to the Compose Modifier, allowing for conditional application based on a specified condition. The new applyIf extension function provides a more flexible way to apply modifiers conditionally within Compose functions.

Commit Details:

  • Added the applyIf extension function to the Modifier class.
  • The applyIf function conditionally applies the provided block of modifiers based on the specified condition.
  • The applyIf function enhances the flexibility of Compose Modifier usage, enabling more dynamic UI compositions.

Example Usage:

// Apply a modifier only if the condition is met
modifier.applyIf(condition) {
    offset(30f)
    clickable {}
}

@teogor teogor added @priority-medium @feature New feature or request labels Oct 4, 2023
@teogor teogor added this to the 1.0.0-alpha03 milestone Oct 4, 2023
@teogor teogor self-assigned this Oct 4, 2023
@teogor teogor merged commit 2a24d51 into main Oct 4, 2023
4 checks passed
@zeobot zeobot bot deleted the feature/compose-modifier-enhancements branch October 4, 2023 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@feature New feature or request @priority-medium
Projects
Development

Successfully merging this pull request may close these issues.

1 participant