toBool method

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

Converts the string to a bool. strict mode only allows '1' and 'true' to return true.

Implementation

bool toBool([bool strict = false]) => strict == true ? this == '1' || this == 'true' : this != '0' && this != 'false' && isNotEmpty;