Polls.castVote constructor

const Polls.castVote({
  1. Key? key,
  2. required List<PollOption> children,
  3. required Widget? question,
  4. required PollCallBack? onVote,
  5. bool allowCreatorVote = false,
  6. Color onVoteBorderColor = Colors.blue,
  7. Color backgroundColor = Colors.grey,
  8. Color? voteCastedBackgroundColor = Colors.blueGrey,
  9. TextStyle? pollStyle,
  10. double optionBarRadius = 16,
  11. double borderWidth = .25,
  12. double optionHeight = 35,
  13. double optionSpacing = 8,
})

this creates view for users to cast votes

Implementation

const Polls.castVote({
  Key? key,
  required this.children,
  required this.question,
  required this.onVote,
  this.allowCreatorVote = false,
  this.onVoteBorderColor = Colors.blue,
  this.backgroundColor = Colors.grey,
  this.voteCastedBackgroundColor = Colors.blueGrey,
  this.pollStyle,
  this.optionBarRadius = 16,
  this.borderWidth = .25,
  this.optionHeight = 35,
  this.optionSpacing = 8,
})  : viewType = PollsType.voter,
      userChoice = null,
      highest = null,
      getHighest = null,
      getTotal = null,
      iconColor = null,
      voteData = null,
      currentUser = null,
      creatorID = null,
      leadingBackgroundColor = null,
      leadingPollStyle = null,
      onVoteBackgroundColor = null,
      voteCastedBorderColor = Colors.transparent,
      assert(onVote != null),
      super(key: key);