toBool method
Converts the integer to a boolean.
Returns true
if the value matches the given value
, otherwise false
.
Example:
print(1.toBool()); // true
print(0.toBool()); // false
print(5.toBool(5)); // true
Implementation
bool toBool([int value = 1]) => this == value;