conditional_builder 1.0.1 copy "conditional_builder: ^1.0.1" to clipboard
conditional_builder: ^1.0.1 copied to clipboard

outdated

Synchronous conditional widget renderer.

ConditionalBuilder #

Synchronous conditional widget renderer. Lets you declaratively render a widget based on a condition. Using this you can get rid of implicit conditional statements in your code to display/hide a widget.

Usage #

After following the installation guide, you can use this widget as follow:

ConditionalBuilder(
  condition: true,
  builder: (context) {
    return Text('This gets rendered');
  },
 )

ConditionalBuilder(
  condition: false,
  builder: (context) {
    return Text('This does not get rendered, an empty Container will be rendered');
  },
)

ConditionalBuilder(
  condition: false,
  builder: (context) {
    return Text('This does not get rendered, as fallback is not null, it is used to render the fallback widget.');
  },
  fallback: (context) {
    return Text('This gets rendered');
  }
)
40
likes
10
pub points
87%
popularity

Publisher

unverified uploader

Synchronous conditional widget renderer.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on conditional_builder