deletePoll method

Future<void> deletePoll({
  1. required int pollId,
  2. OnCompleteCallback? onCompleted,
})

Delete Poll

Implementation

Future<void> deletePoll({
  required int pollId,
  OnCompleteCallback? onCompleted,
}) async {
  try {
    await _sdk.api.send(PollDeleteRequest(pollId: pollId));
    if (onCompleted != null) {
      onCompleted(true, null);
    }
  } catch (e) {
    if (onCompleted != null) {
      onCompleted(false, SBError(message: 'Failed deleting Poll'));
    }
    throw SBError(message: e.toString());
  }
  return;
}