peekBoolValue method
- @Deprecated('Use element.getXyz().getField(abc).toBoolValue() instead of ConstantReader(xyzTypeChecker.firstAnnotationOf(element)).peekBoolValue(abc).')
bool?
peekBoolValue(
- String field
)
Returns the value of the field
as a bool or null
if the field is not a bool.
Implementation
@Deprecated(
'Use element.getXyz().getField(abc).toBoolValue() instead of ConstantReader(xyzTypeChecker.firstAnnotationOf(element)).peekBoolValue(abc).',
)
bool? peekBoolValue(String field) {
final reader = peek(field);
return reader != null && reader.isBool ? reader.boolValue : null;
}