save method
- T model,
- {bool? remote,
- Map<
String, dynamic> ? params, - Map<
String, String> ? headers, - OnSuccessOne<
T> ? onSuccess, - OnErrorOne<
T> ? onError, - DataRequestLabel? label}
Saves model
of type T
.
If remote
is true
, it will initiate an HTTP call.
Always persists to local storage.
Arguments params
and headers
will be merged with
_RemoteAdapter.defaultParams
and _RemoteAdapter.defaultHeaders
, respectively.
See also: _RemoteAdapter.urlForSave
, _RemoteAdapter.methodForSave
.
Implementation
Future<T> save(
T model, {
bool? remote,
Map<String, dynamic>? params,
Map<String, String>? headers,
OnSuccessOne<T>? onSuccess,
OnErrorOne<T>? onError,
DataRequestLabel? label,
}) {
return remoteAdapter.save(
model,
remote: remote,
params: params,
headers: headers,
onSuccess: onSuccess,
onError: onError,
label: label,
);
}