checkBool static method

bool checkBool(
  1. dynamic input,
  2. String fieldName
)

Implementation

static bool checkBool(dynamic input, String fieldName) {
  if (input is bool) return input;
  throw FormatException("Expected bool for '$fieldName', got ${input.runtimeType}");
}