v1/src/source_gen/template_compiler/dart_object_utils library

Functions

coerceBool(DartObject? value, String field, {required bool defaultTo}) bool
Reads and returns field on value as a boolean.
coerceEnum<T>(DartObject? object, String field, List<T> values, {required T defaultTo}) → T
Reads and returns field on value as an enum from values.
coerceInt(DartObject? value, String field, {required int defaultTo}) int
Reads and returns field on value as an integer.
coerceList(DartObject? value, String field, {List<DartObject> defaultTo = const []}) List<DartObject>
Reads and returns field on value as a list.
coerceString(DartObject? value, String field, {String? defaultTo}) String?
Reads and returns field on value as a string.
coerceStringList(DartObject? value, String field, {List<String> defaultTo = const []}) List<String>
Reads and returns field on value as a list of strings.
getField(DartObject? object, String field) → DartObject?
Recursively gets the field from the DartObject.
isNull(DartObject? object) bool
Returns whether object is null or represents the value null.
typeDeclarationOf(DartObject value) → Element?
Returns the element representing the declaration of value's type.
visitAll<T>(Iterable<DartObject> objs, T? recurseFn(DartObject)) List<T>
Visits all of the DartObjects, accumulating the results of recuseFn.