deletePollOption method

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

Delete Poll Option

Implementation

Future<void> deletePollOption({
  required int pollId,
  required int pollOptionId,
  OnCompleteCallback? onCompleted,
}) async {
  try {
    await _sdk.api.send(PollOptionDeleteRequest(
      pollId: pollId,
      pollOptionId: pollOptionId,
    ));
    if (onCompleted != null) {
      onCompleted(true, null);
    }
  } catch (e) {
    if (onCompleted != null) {
      onCompleted(false, SBError(message: 'Failed deleting poll opiton.'));
    }
  }
}