Polls constructor

const Polls({
  1. Key? key,
  2. required List<PollOption> children,
  3. required Map<String, int>? voteData,
  4. required String? currentUser,
  5. required String? creatorID,
  6. Widget? question,
  7. int? userChoice,
  8. bool allowCreatorVote = false,
  9. PollCallBack? onVote,
  10. Color onVoteBorderColor = Colors.blue,
  11. Color voteCastedBorderColor = Colors.transparent,
  12. Color backgroundColor = Colors.blueGrey,
  13. Color? voteCastedBackgroundColor = Colors.grey,
  14. Color? onVoteBackgroundColor = Colors.blue,
  15. TextStyle? leadingPollStyle,
  16. TextStyle? pollStyle,
  17. Color? iconColor = Colors.black,
  18. Color? leadingBackgroundColor = Colors.blueGrey,
  19. double optionBarRadius = 16,
  20. double borderWidth = .25,
  21. double optionHeight = 35,
  22. double optionSpacing = 8,
})

Polls contruct by default get view for voting

Implementation

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