copyWith method

Poll copyWith({
  1. int? id,
  2. FormattedText? question,
  3. List<PollOption>? options,
  4. int? totalVoterCount,
  5. List<MessageSender>? recentVoterIds,
  6. bool? canGetVoters,
  7. bool? canSeeResults,
  8. bool? isAnonymous,
  9. bool? allowsMultipleAnswers,
  10. bool? allowsRevoting,
  11. bool? membersOnly,
  12. List<String>? countryCodes,
  13. List<int>? optionOrder,
  14. PollType? type,
  15. int? openPeriod,
  16. int? closeDate,
  17. bool? isClosed,
  18. PollVoteRestrictionReason? voteRestrictionReason,
})

Implementation

Poll copyWith({
  int? id,
  FormattedText? question,
  List<PollOption>? options,
  int? totalVoterCount,
  List<MessageSender>? recentVoterIds,
  bool? canGetVoters,
  bool? canSeeResults,
  bool? isAnonymous,
  bool? allowsMultipleAnswers,
  bool? allowsRevoting,
  bool? membersOnly,
  List<String>? countryCodes,
  List<int>? optionOrder,
  PollType? type,
  int? openPeriod,
  int? closeDate,
  bool? isClosed,
  PollVoteRestrictionReason? voteRestrictionReason,
}) =>
    Poll(
      id: id ?? this.id,
      question: question ?? this.question,
      options: options ?? this.options,
      totalVoterCount: totalVoterCount ?? this.totalVoterCount,
      recentVoterIds: recentVoterIds ?? this.recentVoterIds,
      canGetVoters: canGetVoters ?? this.canGetVoters,
      canSeeResults: canSeeResults ?? this.canSeeResults,
      isAnonymous: isAnonymous ?? this.isAnonymous,
      allowsMultipleAnswers:
          allowsMultipleAnswers ?? this.allowsMultipleAnswers,
      allowsRevoting: allowsRevoting ?? this.allowsRevoting,
      membersOnly: membersOnly ?? this.membersOnly,
      countryCodes: countryCodes ?? this.countryCodes,
      optionOrder: optionOrder ?? this.optionOrder,
      type: type ?? this.type,
      openPeriod: openPeriod ?? this.openPeriod,
      closeDate: closeDate ?? this.closeDate,
      isClosed: isClosed ?? this.isClosed,
      voteRestrictionReason:
          voteRestrictionReason ?? this.voteRestrictionReason,
    );