PollOptionGetListVotersRequest constructor Null safety

PollOptionGetListVotersRequest(
  1. {required int pollId,
  2. required int pollOptionId,
  3. required String channelUrl,
  4. required ChannelType channelType,
  5. String? token,
  6. int limit = 100}
)

Implementation

PollOptionGetListVotersRequest({
  required int pollId,
  required int pollOptionId,
  required String channelUrl,
  required ChannelType channelType,
  String? token,
  int limit = 100,
}) : assert(1 <= limit && limit <= 100) {
  url = 'polls/$pollId/options/$pollOptionId/voters';
  queryParams = {
    'token': token,
    'channel_url': channelUrl,
    'limit': limit,
    'channel_type': channelType.urlString,
  };

  queryParams.removeWhere((key, value) => value == null);
}