DataModelMixin<T extends DataModelMixin<T>> mixin

Data classes extending this class are marked to be managed through Flutter Data.

It enforces the implementation of an id getter. It contains private state and methods to track the model's identity.

Mixin applications
Available extensions

Properties

asBelongsTo BelongsTo<T>

Available on DataModelMixin<T>, provided by the DataModelRelationshipExtension extension

Converts a DataModel<T> into a BelongsTo<T>.
no setter
hashCode int
The hash code for this object.
no setterinherited
id Object?
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

delete({bool remote = true, Map<String, dynamic>? params, Map<String, String>? headers, OnSuccessOne<T>? onSuccess, OnErrorOne<T>? onError}) Future<T?>

Available on DataModelMixin<T>, provided by the DataModelExtension extension

Deletes this model through a call equivalent to Adapter.delete.
deleteLocal() → void

Available on DataModelMixin<T>, provided by the DataModelExtension extension

Deletes this model from local storage.
init() → T
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reload({bool remote = true, Map<String, dynamic>? params, Map<String, String>? headers, bool background = false, DataRequestLabel? label}) Future<T?>

Available on DataModelMixin<T>, provided by the DataModelExtension extension

Reload this model through a call equivalent to Adapter.findOne. with the current object/id
reloadLocal() → T?

Available on DataModelMixin<T>, provided by the DataModelExtension extension

Reload model from local storage.
save({bool remote = true, Map<String, dynamic>? params, Map<String, String>? headers, OnSuccessOne<T>? onSuccess, OnErrorOne<T>? onError}) Future<T>

Available on DataModelMixin<T>, provided by the DataModelExtension extension

Saves this model through a call equivalent to save.
saveLocal() → T

Available on DataModelMixin<T>, provided by the DataModelExtension extension

Saves this model to local storage.
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

keyFor(DataModelMixin<DataModelMixin> model) String?
relationshipsFor(DataModelMixin<DataModelMixin> model) Set<Relationship<DataModelMixin, dynamic>>
Returns a model's non-null relationships.