BoolUtils extension

Extensions on bool for real-world utility operations.

on

Properties

toggled → bool

Available on bool, provided by the BoolUtils extension

Returns the logical negation of this value.
no setter

Methods

ifFalse<T>(T value) → T?

Available on bool, provided by the BoolUtils extension

Returns value if this is false, otherwise null.
ifTrue<T>(T value) → T?

Available on bool, provided by the BoolUtils extension

Returns value if this is true, otherwise null.
toEnabledDisabled() → String

Available on bool, provided by the BoolUtils extension

Returns 'Enabled' or 'Disabled'.
toOnOff() → String

Available on bool, provided by the BoolUtils extension

Returns 'On' or 'Off'.
toYesNo() → String

Available on bool, provided by the BoolUtils extension

Returns 'Yes' or 'No'.
when<T>({required T onTrue(), required T onFalse()}) → T

Available on bool, provided by the BoolUtils extension

Calls onTrue if true, onFalse if false, and returns the result.