OrdereableModel mixin

A GenericModel that has an ordinal parameter. When used with a ReorderableMap, by default greater ordinal values should be shown first.

This is to make it convenient to add a custom sort feature.

Superclass constraints
Available extensions

Properties

autoGenId String

Available on BaseModel, provided by the BaseModelIDExtension extension

Returns id if that value is not null. Otherwise will automatically generate a new value for id with the idSuffix setter.
no setter
fieldKeys Iterable<String>
Returns all the available field keys in this object.
no setterinherited
getterSetterMap MappableFields
Used by toMap to generate the map
latefinalinherited
hashCode int
The hash code for this object.
no setterinherited
id String?
Unique identifier for this model
getter/setter pairinherited
idKey String
Represents the field key used for the id
no setterinherited
idSuffix String?

Available on BaseModel, provided by the BaseModelIDExtension extension

Returns the last part of this id, which is always a unique identifier.
getter/setter pair
ordinal int
Compared with other instances of OrdereableModel to set the custom sort.
getter/setter pair
ordinalGetterSetter → Tuple2<Getter, Setter>
Add this to your implementation of the getGetterSetterMap function of GenericModel
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type String
Unique type to give to the model. Whether or not collision is expected is dependent on the parameters of your system.
no setterinherited
typeKey String
Represents the field key used for the type
no setterinherited

Methods

copy<T extends BaseModel>(T model, {bool allowDifferentTypes = false, bool copyId = true, Iterable<String>? onlyFields, Iterable<String>? exceptFields}) → void

Available on BaseModel, provided by the BaseModelFieldExtension extension

Copies values from the given model into this model.
fieldsToEvaluate<T extends BaseModel>(Iterable<String>? onlyFields, Iterable<String>? exceptFields) Iterable<String>

Available on BaseModel, provided by the BaseModelFieldExtension extension

Returns the fields that exist in this model.
getField(String key) → dynamic
Returns the value of the field with name key or null if key is not a field in this model.
inherited
getGetterSetterMap() MappableFields
Implemented by subclasses to map the getters and setters of the object.
inherited
hasSameFields<T extends BaseModel>({required T model, Iterable<String>? onlyFields, Iterable<String>? exceptFields}) bool

Available on BaseModel, provided by the BaseModelFieldExtension extension

Returns whether the given model has the same given fields as this model.
loadFromJsonString(String encodedString) → void

Available on BaseModel, provided by the JsonStringModel extension

Loads encodedString into this model's values.
loadFromMap(Map<String, dynamic> map, {bool respectType = true}) → void
Loads a Serializable map into the values of this BaseModel
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
prefixTypeForId(String idSuffix) String

Available on BaseModel, provided by the BaseModelIDExtension extension

Prefixes this BaseModel's type to idSuffix
setField(String key, dynamic value) bool
Sets the field with name key to the given value
inherited
toJsonString() String

Available on BaseModel, provided by the JsonStringModel extension

Serializes this model into a json Object map string.
toMap() Map<String, dynamic>
Converts this BaseModel into a Serializable Map.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited