toBool method

bool toBool([
  1. bool def = false
])

Converts a JavaScript value to a Dart boolean.

Returns def when the value cannot be interpreted as a boolean.

Implementation

bool toBool([bool def = false]) => toNullableBool() ?? def;