DataModelExtension<T extends DataModel<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, OnData<void>? onSuccess, OnDataError<void>? onError}) Future<void>
Deletes this model through a call equivalent to Repository.delete.
reload({bool? remote, Map<String, dynamic>? params, Map<String, String>? headers}) Future<T?>
Re-fetch this model through a call equivalent to Repository.findOne. with the current object/id
save({bool? remote, Map<String, dynamic>? params, Map<String, String>? headers, OnData<T>? onSuccess, OnDataError<T>? onError}) Future<T>
Saves this model through a call equivalent to Repository.save.
was(T model) → T
Initializes a model copying the identity of supplied model.
watch({bool? remote, Map<String, dynamic>? params, Map<String, String>? headers, AlsoWatch<T>? alsoWatch}) DataStateNotifier<T?>
Watch this model through a call equivalent to Repository.watchOne. with the current object/id.