delete method

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

Deletes this model through a call equivalent to Repository.delete.

Usage: await post.delete()

Requires this model to be initialized.

Implementation

Future<void> delete({
  bool? remote,
  Map<String, dynamic>? params,
  Map<String, String>? headers,
  OnData<void>? onSuccess,
  OnDataError<void>? onError,
}) async {
  _assertInit('delete');
  await remoteAdapter.delete(
    this,
    remote: remote,
    params: params,
    headers: headers,
    onSuccess: onSuccess,
    onError: onError,
  );
}