PollChoice constructor

const PollChoice({
  1. required int id,
  2. @JsonKey.new(name: 'choice_text') required String choiceText,
  3. @JsonKey.new(name: 'sort_order') int? sortOrder,
  4. @JsonKey.new(name: 'num_votes') @Default.new(0) int numVotes,
})

Implementation

const factory PollChoice({
  required int id,
  @JsonKey(name: 'choice_text') required String choiceText,
  @JsonKey(name: 'sort_order') int? sortOrder,
  @JsonKey(name: 'num_votes') @Default(0) int numVotes,
}) = _PollChoice;