updatePollOption method
Future<Poll>
updatePollOption({
- required int pollId,
- required int pollOptionId,
- required String optionText,
- OnPollCallback? onCompleted,
Update Poll Option
Implementation
Future<Poll> updatePollOption({
required int pollId,
required int pollOptionId,
required String optionText,
OnPollCallback? onCompleted,
}) async {
Poll poll = await _sdk.api
.send(
PollOptionUpdateRequest(
pollId: pollId,
pollOptionId: pollOptionId,
text: optionText,
),
)
.onError((error, stackTrace) {
if (onCompleted != null) {
onCompleted(null, SBError(message: 'Failed updating poll option'));
}
throw SBError(message: "Failed updating poll option");
});
if (onCompleted != null) {
onCompleted(poll, null);
}
return poll;
}