ifTrue method

void ifTrue(
  1. void action()
)

Runs action only when the value is true.

Example:

isEnabled.ifTrue(() => save());

Implementation

void ifTrue(void Function() action) {
  if (this) {
    action();
  }
}