Polls constructor

const Polls({
  1. Key? key,
  2. required List children,
  3. required Text question,
  4. required Map? voteData,
  5. required String? currentUser,
  6. required String? creatorID,
  7. int? userChoice,
  8. bool allowCreatorVote = false,
  9. PollCallBack? onVote,
  10. Color outlineColor = Colors.blue,
  11. Color backgroundColor = Colors.blueGrey,
  12. Color? onVoteBackgroundColor = Colors.blue,
  13. TextStyle? leadingPollStyle,
  14. TextStyle pollStyle = const TextStyle(),
  15. Color? iconColor = Colors.black,
  16. Color? leadingBackgroundColor = Colors.blueGrey,
})

Polls contruct by default get view for voting

Implementation

const Polls({super.key,
  required   this.children,
  required  this.question,
  required  this.voteData,
  required this.currentUser,
  required this.creatorID,
  this.userChoice,
  this.allowCreatorVote = false,
  this.onVote,
  this.outlineColor = Colors.blue,
  this.backgroundColor = Colors.blueGrey,
  this.onVoteBackgroundColor = Colors.blue,
  this.leadingPollStyle,
  this.pollStyle = const TextStyle(),
  this.iconColor = Colors.black,
  this.leadingBackgroundColor = Colors.blueGrey,
})  : highest = null,
      getHighest = null,
      getTotal = null,
      viewType = null,
      assert(onVote != null),
      assert(question != null),
      assert(children != null),
      assert(voteData != null),
      assert(currentUser != null),
      assert(creatorID != null);