copyWith method
InputMessagePoll
copyWith({
- FormattedText? question,
- List<
InputPollOption> ? options, - FormattedText? description()?,
- InputPollMedia? media()?,
- bool? isAnonymous,
- bool? allowsMultipleAnswers,
- bool? allowsRevoting,
- bool? membersOnly,
- List<
String> ? countryCodes, - bool? shuffleOptions,
- bool? hideResultsUntilCloses,
- InputPollType? type,
- int? openPeriod,
- int? closeDate,
- bool? isClosed,
override
Returns a copy with the given fields replaced. For a nullable
field pass a function, e.g. field: () => null to clear it.
Implementation
@override
InputMessagePoll copyWith({
FormattedText? question,
List<InputPollOption>? options,
FormattedText? Function()? description,
InputPollMedia? Function()? media,
bool? isAnonymous,
bool? allowsMultipleAnswers,
bool? allowsRevoting,
bool? membersOnly,
List<String>? countryCodes,
bool? shuffleOptions,
bool? hideResultsUntilCloses,
InputPollType? type,
int? openPeriod,
int? closeDate,
bool? isClosed,
}) => InputMessagePoll(
question: question ?? this.question,
options: options ?? this.options,
description: description != null ? description() : this.description,
media: media != null ? media() : this.media,
isAnonymous: isAnonymous ?? this.isAnonymous,
allowsMultipleAnswers: allowsMultipleAnswers ?? this.allowsMultipleAnswers,
allowsRevoting: allowsRevoting ?? this.allowsRevoting,
membersOnly: membersOnly ?? this.membersOnly,
countryCodes: countryCodes ?? this.countryCodes,
shuffleOptions: shuffleOptions ?? this.shuffleOptions,
hideResultsUntilCloses:
hideResultsUntilCloses ?? this.hideResultsUntilCloses,
type: type ?? this.type,
openPeriod: openPeriod ?? this.openPeriod,
closeDate: closeDate ?? this.closeDate,
isClosed: isClosed ?? this.isClosed,
);