delete method

Future<void> delete(
  1. dynamic model, {
  2. bool? remote,
  3. Map<String, dynamic>? params,
  4. Map<String, String>? headers,
  5. OnData<void>? onSuccess,
  6. OnDataError<void>? onError,
})

Deletes model of type T.

If remote is true, it will initiate an HTTP call.

Always deletes from local storage.

Arguments params and headers will be merged with _RemoteAdapter.defaultParams and _RemoteAdapter.defaultHeaders, respectively.

See also: _RemoteAdapter.urlForDelete, _RemoteAdapter.methodForDelete.

Implementation

Future<void> delete(
  dynamic model, {
  bool? remote,
  Map<String, dynamic>? params,
  Map<String, String>? headers,
  OnData<void>? onSuccess,
  OnDataError<void>? onError,
}) {
  return remoteAdapter.delete(
    model,
    remote: remote,
    params: params,
    headers: headers,
    onSuccess: onSuccess,
    onError: onError,
  );
}