toBoolean static method

bool toBoolean(
  1. dynamic v
)

Implementation

static bool toBoolean(v) {
  if (v is bool) {
    return v;
  } else if (v is String) {
    return v == 'true';
  } else if (v == null) {
    return v == false;
  }
  return false;
}