readBoolValue method

  1. @Deprecated('Use element.getXyz().getField(abc).toBoolValue() instead of ConstantReader(xyzTypeChecker.firstAnnotationOf(element)).readBoolValue(abc).')
bool readBoolValue(
  1. String field
)

Returns the value of the field as a bool or throws a FormatException if the field is not a bool.

Implementation

@Deprecated(
  'Use element.getXyz().getField(abc).toBoolValue() instead of ConstantReader(xyzTypeChecker.firstAnnotationOf(element)).readBoolValue(abc).',
)
bool readBoolValue(String field) {
  final reader = read(field);

  return reader.isBool ? reader.boolValue : throw FormatException();
}