readBoolValue method
- @Deprecated('Use element.getXyz().getField(abc).toBoolValue() instead of ConstantReader(xyzTypeChecker.firstAnnotationOf(element)).readBoolValue(abc).')
- 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();
}