listBool method

List<bool?>? listBool(
  1. String i, [
  2. bool required = false
])

get value as list of bool

if required argument is true then all the list is not null

Implementation

List<bool?>? listBool(String i, [bool required = false]) {
  final data = map[i];
  if (data == null) {
    throw HTTPException(422, 'field $i is required');
  }
  return data.map((e) {
    bool? i2 = e.toBool();
    if (i2 == null && required) {
      throw HTTPException(422, 'field $i is not a list of booleans');
    }
    return i2;
  }).toList();
}