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<
Converts a DataModel<T> into a BelongsTo<T>.T> , provided by the DataModelRelationshipExtension extensionno 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<
Deletes this model through a call equivalent toT> , provided by the DataModelExtension extensionAdapter.delete
. -
deleteLocal(
) → void -
Available on DataModelMixin<
Deletes this model from local storage.T> , provided by the DataModelExtension extension -
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<
Reload this model through a call equivalent toT> , provided by the DataModelExtension extensionAdapter.findOne
. with the current object/id -
reloadLocal(
) → T? -
Available on DataModelMixin<
Reload model from local storage.T> , provided by the DataModelExtension extension -
save(
{bool remote = true, Map< String, dynamic> ? params, Map<String, String> ? headers, OnSuccessOne<T> ? onSuccess, OnErrorOne<T> ? onError}) → Future<T> -
Available on DataModelMixin<
Saves this model through a call equivalent to save.T> , provided by the DataModelExtension extension -
saveLocal(
) → T -
Available on DataModelMixin<
Saves this model to local storage.T> , provided by the DataModelExtension extension -
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.