DataModelExtension<T extends DataModelMixin<T>> extension

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

on

Methods

delete({bool remote = true, Map<String, dynamic>? params, Map<String, String>? headers, OnSuccessOne<T>? onSuccess, OnErrorOne<T>? onError}) Future<T?>
Deletes this model through a call equivalent to Adapter.delete.
deleteLocal() → void
Deletes this model from local storage.
reload({bool remote = true, Map<String, dynamic>? params, Map<String, String>? headers, bool? background, DataRequestLabel? label}) Future<T?>
Reload this model through a call equivalent to Adapter.findOne. with the current object/id
reloadLocal() → T?
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>
Saves this model through a call equivalent to save.
saveLocal() → T
Saves this model to local storage.