BoolExtensions extension
Extensions for bool operations and utilities.
- on
Properties
- toggled → bool
-
Available on bool, provided by the BoolExtensions extension
Returns the logical negation of this value.no setter
Methods
-
fold<
T> (T whenTrue, T whenFalse) → T -
Available on bool, provided by the BoolExtensions extension
ReturnswhenTrueiftrue, otherwisewhenFalse. -
ifFalse(
void action()) → void -
Available on bool, provided by the BoolExtensions extension
Runsactiononly when the value isfalse. -
ifTrue(
void action()) → void -
Available on bool, provided by the BoolExtensions extension
Runsactiononly when the value istrue. -
toInt(
) → int -
Available on bool, provided by the BoolExtensions extension
Converts the boolean to an integer (true-> 1,false-> 0). -
toYesNo(
{String yes = 'Yes', String no = 'No'}) → String -
Available on bool, provided by the BoolExtensions extension
Returns'Yes'whentrueand'No'whenfalse.