entityType property
Type?
get
entityType
Returns a valid entity Type.
- If this TypeInfo is an EntityReferenceBase it will return the EntityReferenceBase.type.
- If this TypeInfo is an List it will return the arguments0. See EntityHandler.isValidEntityType.
Implementation
Type? get entityType {
var type = this.type;
Type? entityType;
if (type.isEntityReferenceBaseType) {
entityType = arguments0?.type;
} else if (isList) {
entityType = arguments0?.type;
} else {
entityType = type;
}
return EntityHandler.isValidEntityType(entityType) ? entityType : null;
}