create static method

PollOption create({
  1. bool schemeUtilsIsSetDefaultData = false,
  2. String special_type = "pollOption",
  3. String special_return_type = "pollOption",
  4. FormattedText? text,
  5. num? voter_count,
  6. num? vote_percentage,
  7. bool? is_chosen,
  8. bool? is_being_chosen,
})
override

Generate By General Universe Script Dont edit by hand or anything manual

Implementation

static PollOption create({
  bool schemeUtilsIsSetDefaultData = false,
  String special_type = "pollOption",
  String special_return_type = "pollOption",
  FormattedText? text,
  num? voter_count,
  num? vote_percentage,
  bool? is_chosen,
  bool? is_being_chosen,
}) {
  // PollOption pollOption = PollOption({
  final Map pollOption_data_create_json = {
    "@type": special_type,
    "@return_type": special_return_type,
    "text": (text != null) ? text.toJson() : null,
    "voter_count": voter_count,
    "vote_percentage": vote_percentage,
    "is_chosen": is_chosen,
    "is_being_chosen": is_being_chosen,
  };

  pollOption_data_create_json.removeWhere((key, value) => value == null);

  if (schemeUtilsIsSetDefaultData) {
    defaultData.forEach((key, value) {
      if (pollOption_data_create_json.containsKey(key) == false) {
        pollOption_data_create_json[key] = value;
      }
    });
  }
  return PollOption(pollOption_data_create_json);
}