builder_when 1.1.1 copy "builder_when: ^1.1.1" to clipboard
builder_when: ^1.1.1 copied to clipboard

The BuilderWhen class is a simple yet powerful tool designed for Flutter applications.

BuilderWhen: A Conditional Build Creator for Flutter #

Overview #

The BuilderWhen class is a simple yet powerful tool designed for Flutter applications. It provides a streamlined way to conditionally build and display widgets based on a given condition.

Features #

  • Conditional Rendering: Effortlessly render different widgets based on a boolean condition.
  • Simplicity and Efficiency: Minimalistic and easy-to-understand syntax that enhances code readability and maintainability.

Usage #

To use BuilderWhen, simply provide a condition, isTrue widget, and isFalse widget. Based on the state of the condition, either isTrue or isFalse will be rendered. This functionality is particularly useful for scenarios where UI elements need to change dynamically in response to user interactions or data changes.

Example #

BuilderWhen(
  condition: condition,
  isTrue: (context) => Text(
    'Condition is TRUE',
    style: TextStyle(fontSize: 24, color: Colors.green),
  ),
  isFalse: (context) => Text(
    'Condition is FALSE',
    style: TextStyle(fontSize: 24, color: Colors.red),
  ),
)

Made with ❤ in Brazil

4
likes
160
points
30
downloads

Publisher

verified publisherjuarezfranco.com.br

Weekly Downloads

The BuilderWhen class is a simple yet powerful tool designed for Flutter applications.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter

More

Packages that depend on builder_when