condition_builder 2.0.0
condition_builder: ^2.0.0 copied to clipboard
A tiny Flutter utility that helps you write clean, readable multi-way conditional logic directly inside widget attributes — without `if`/`else` and without nested complex ternary statements.
2.0.0 #
- Asynchronous support removed: This package is intended primarily for simplifying complex conditional logic within Flutter widget attributes. For asynchronous calls, using
if/else if/elseconstructs is more appropriate. - Simpler usage:
- The fallback (
orElse) is no longer set on the builder itself. - Instead, you can optionally provide a fallback directly when calling
build(), for example:.build(orElse: () => defaultValue);
- The fallback (
- No fallback? No match?:
Thebuild()method will never returnnull. If no conditions match and no fallback is provided, it throws an error to alert you. onIfmethod removed:
To add conditions conditionally, combine your checks inside theon()condition function yourself.
These changes make the builder easier and more predictable to use!
1.0.0 #
- First release.