Overview
The 'conditioned' package provides a simple Widget that conditionally displays a child based on one or more boolean conditions. It streamlines the process of showing or hiding UI elements by wrapping the logic in a clean, reusable component. Ideal for dynamic UIs where visibility depends on state changes, it enhances readability compared to nested ternary operators or if-else blocks. The package supports all major platforms including Android, iOS, Web, macOS, Windows, and Linux.
Use cases
- Conditional UI rendering
- Dynamic widget visibility
- Simplifying complex visibility logic
- Form validation feedback
- Loading state management
Key features
- Simple condition-based display
- Supports multiple conditions
- Cross-platform compatibility
- Clean, readable syntax
- Minimal boilerplate
Suitable for
- Developers seeking concise conditional rendering
- Projects with frequent UI state changes
- Teams prioritizing code readability
- Apps requiring responsive UI components
- Flutter beginners learning state management
Considerations
- Limited to boolean conditions
- Does not handle async states directly
- No built-in animation support
- Best used with state management solutions
- Not suitable for complex conditional workflows