copyWith method
Returns a copy with the given fields replaced. For a nullable
field pass a function, e.g. field: () => null to clear it.
Implementation
Poll copyWith({
int? id,
String? question,
List<PollOption>? options,
int? totalVoterCount,
List<MessageSender>? recentVoterIds,
bool? isAnonymous,
PollType? type,
int? openPeriod,
int? closeDate,
bool? isClosed,
}) =>
Poll(
id: id ?? this.id,
question: question ?? this.question,
options: options ?? this.options,
totalVoterCount: totalVoterCount ?? this.totalVoterCount,
recentVoterIds: recentVoterIds ?? this.recentVoterIds,
isAnonymous: isAnonymous ?? this.isAnonymous,
type: type ?? this.type,
openPeriod: openPeriod ?? this.openPeriod,
closeDate: closeDate ?? this.closeDate,
isClosed: isClosed ?? this.isClosed,
);