DataModelExtension<T extends DataModelMixin<T>> extension

Extension that adds syntax-sugar to data classes, linking them to common Repository methods such as save and delete.

on

Methods

delete({bool? remote, Map<String, dynamic>? params, Map<String, String>? headers, OnSuccessOne<T>? onSuccess, OnErrorOne<T>? onError}) Future<T?>
Deletes this model through a call equivalent to Repository.delete.
deleteLocal() → void
Deletes this model from local storage.
reload({bool? remote, Map<String, dynamic>? params, Map<String, String>? headers, bool? background, DataRequestLabel? label}) Future<T?>
Reload this model through a call equivalent to Repository.findOne. with the current object/id
reloadLocal() → T?
Reload model from local storage.
save({bool? remote, Map<String, dynamic>? params, Map<String, String>? headers, OnSuccessOne<T>? onSuccess, OnErrorOne<T>? onError}) Future<T>
Saves this model through a call equivalent to Repository.save.
saveLocal() → T
Saves this model to local storage.
withKeyOf(T model) → T
Copy identity (internal key) from an old model to a new one to signal they are the same.