PollOptionAddRequest constructor Null safety

PollOptionAddRequest(
  1. {required int pollId,
  2. required String text,
  3. required String channelUrl,
  4. required ChannelType channelType}
)

Implementation

PollOptionAddRequest({
  required int pollId,
  required String text,
  required String channelUrl,
  required ChannelType channelType,
}) : assert(text.length <= 2000) {
  url = 'polls/$pollId/options';
  body = {
    'text': text,
    'channel_url': channelUrl,
    'channel_type': channelType.urlString,
  };
}