create static method
Create Poll
Implementation
static Future<Poll> create({
required PollCreateParams params,
OnPollCallback? onCompleted,
}) async {
final sdk = SendbirdSdk().getInternal();
var poll = await sdk.api
.send(PollCreateRequest(params: params))
.onError((error, stackTrace) {
if (onCompleted != null) {
onCompleted(null, SBError(message: 'Failed Creating Poll'));
}
throw SBError(message: 'Failed Creating Poll');
});
if (onCompleted != null) {
onCompleted(poll, null);
}
return poll;
}