delete<T extends Model> method

  1. @override
Future<void> delete<T extends Model>(
  1. T model, {
  2. QueryPredicate<Model>? where,
})
override

Implementation

@override
Future<void> delete<T extends Model>(T model, {QueryPredicate? where}) async {
  try {
    await _setUpObserveIfNeeded();
    var methodChannelDeleteInput = <String, dynamic>{
      'modelName': model.getInstanceType().modelName(),
      if (where != null) 'queryPredicate': where.serializeAsMap(),
      'serializedModel': model.toJson(),
    };
    await _channel.invokeMethod('delete', methodChannelDeleteInput);
  } on PlatformException catch (e) {
    throw _deserializeException(e);
  }
}