isBoolList function
Returns true
if is a list of bool. Can be a string of bool too.
Implementation
bool isBoolList(Object? value, [String delimiter = ',']) {
if (value == null) return false;
if (value is List<bool>) return true;
if (value is Iterable) {
return listMatchesAll(value, (e) => e is bool);
}
var s = value.toString().toLowerCase();
return RegExp(r'^(?:true|false|yes|no)(?:' +
delimiter +
r'(?:true|false|yes|no))+$')
.hasMatch(s);
}