toBoolean static method
Converts a dynamic value to a non-nullable boolean.
d
- The dynamic value to be converted.
def
- The default boolean value if conversion fails.
Returns a boolean.
Implementation
static bool toBoolean(dynamic d, bool def) {
return toBooleanN(d) ?? def;
}