create static method
Poll
create({
- bool schemeUtilsIsSetDefaultData = false,
- String special_type = "poll",
- String special_return_type = "poll",
- num? id,
- FormattedText? question,
- List<
PollOption> ? options, - num? total_voter_count,
- List<
MessageSender> ? recent_voter_ids, - bool? is_anonymous,
- PollType? type,
- num? open_period,
- num? close_date,
- bool? is_closed,
override
Generate By AZKADEV | Azka Axelion Gibran Script Dont edit by hand or anything manual
Implementation
static Poll create({
bool schemeUtilsIsSetDefaultData = false,
String special_type = "poll",
String special_return_type = "poll",
num? id,
FormattedText? question,
List<PollOption>? options,
num? total_voter_count,
List<MessageSender>? recent_voter_ids,
bool? is_anonymous,
PollType? type,
num? open_period,
num? close_date,
bool? is_closed,
}) {
// Poll poll = Poll({
final Map poll_data_create_json = {
"@type": special_type,
"@return_type": special_return_type,
"id": id,
"question": (question != null) ? question.toJson() : null,
"options": (options != null) ? options.toJson() : null,
"total_voter_count": total_voter_count,
"recent_voter_ids": (recent_voter_ids != null) ? recent_voter_ids.toJson() : null,
"is_anonymous": is_anonymous,
"type": (type != null) ? type.toJson() : null,
"open_period": open_period,
"close_date": close_date,
"is_closed": is_closed,
};
poll_data_create_json.removeWhere((key, value) => value == null);
if (schemeUtilsIsSetDefaultData) {
defaultData.forEach((key, value) {
if (poll_data_create_json.containsKey(key) == false) {
poll_data_create_json[key] = value;
}
});
}
return Poll(poll_data_create_json);
}