conditional_builder_null_safety
0.0.6, released 5 years ago by an unverified publisher
Widget that shows builder or fallback based on a boolean condition
WASM-ready
What it does
ConditionalBuilder displays a builder widget when the condition is true and a fallback widget when it is false. If fallback is null, it returns an empty container.
AI-written summary of version 0.0.6, based on the package's README and metadata. Report an inaccuracy
Use it when
- When you need to show different UI based on a simple boolean condition
- When you want a quick way to toggle between two widgets without writing if/else logic
Skip it when
- When the condition depends on complex state that should be managed by a state management solution
- When you need animations or transitions between the two widgets
Strengths
- Simple API
- Null safety support
- Fallback can be omitted
Weaknesses
- Very basic, no animation support
- No documentation on performance or edge cases
- No support for async conditions
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
```dart
ConditionalBuilder(
condition: true,
builder: (context) => Center(child: Text('this is true')),
fallback: (context) => Center(child: Text('this is not true')),
)
```Alternatives
Packages that do the same job and could replace conditional_builder_null_safety.
- adaptive_dialog
Shows platform‑adaptive alert dialogs and action sheets
93Compare - another_transformer_page_view
A PageView widget for Flutter supporting custom page transformers and animations.
50Compare - dart_code_viewer2
A Flutter widget to view, theme, and copy Dart code snippets.
55Compare - modal_progress_hud_nsn
A modal progress indicator widget with Sound Null Safety.
50Compare