delete<_Model extends OfflineFirstWithRestModel> method

  1. @override
Future<bool> delete<_Model extends OfflineFirstWithRestModel>(
  1. _Model instance, {
  2. OfflineFirstDeletePolicy policy = OfflineFirstDeletePolicy.optimisticLocal,
  3. Query? query,
})

Remove a model from SQLite and the remoteProvider

Implementation

@override
Future<bool> delete<_Model extends OfflineFirstWithRestModel>(
  _Model instance, {
  OfflineFirstDeletePolicy policy = OfflineFirstDeletePolicy.optimisticLocal,
  Query? query,
}) async {
  try {
    return await super.delete<_Model>(instance, policy: policy, query: query);
  } on RestException catch (e) {
    logger.warning('#delete rest failure: $e');
    if (_ignoreTunnelException(e)) {
      return false;
    }

    throw OfflineFirstException(e);
  }
}