fieldsIncludingInherited property
Returns a list of all fields in this class, including inherited fields. It ensures that the 'id' field, if present on this class, is always included at the beginning of the list. Non-tail fields are ordered top-down through the inheritance chain. Tail fields are ordered bottom-up so that root parent tail fields appear last.
Implementation
@override
List<SerializableModelFieldDefinition> get fieldsIncludingInherited {
final idField = fields
.where((element) => element.name == defaultPrimaryKeyName)
.firstOrNull;
return _fieldsWithTailFieldsLast(
firstField: idField,
inheritedFields: inheritedFields,
fields: fields.where((element) => element.name != defaultPrimaryKeyName),
);
}