toBool method

bool toBool({
  1. bool caseSensitive = false,
})

Implementation

bool toBool({bool caseSensitive = false}) {
  if (this == null) return false;
  final val = this!.trim();
  if (caseSensitive) return val == 'true';
  return val.toLowerCase() == 'true';
}