delete<T extends RLMObject> method

Future<void> delete<T extends RLMObject>(
  1. dynamic primaryKey
)

Delete object from primaryKey.

Implementation

Future<void> delete<T extends RLMObject>(dynamic primaryKey) async {
  assert(_partition.length != 0);

  Map<String, dynamic> values = {
    'primaryKey': primaryKey,
    'identity': _syncUser.identity,
    'appId': _appId,
    'partition': _partition,
    "type": T.toString()
  };
  Map<dynamic, dynamic> map =
      await _channel.invokeMethod(Action.delete.name, values);

  if (map["error"] != null) {
    throw Exception("create object finished with exception ${map["error"]}");
  }

  return;
}