isBool method

bool isBool({
  1. bool caseSensitive = true,
})

Checks if the string is a valid boolean representation.

Implementation

bool isBool({bool caseSensitive = true}) {
  final val = caseSensitive ? this : toLowerCase();
  return val == 'true' || val == 'false';
}