Polls constructor
const
Polls({
- Key? key,
- required List<
PollOption> children, - required Map<
String, int> ? voteData, - required String? currentUser,
- required String? creatorID,
- Widget? question,
- int? userChoice,
- bool allowCreatorVote = false,
- PollCallBack? onVote,
- Color onVoteBorderColor = Colors.blue,
- Color voteCastedBorderColor = Colors.transparent,
- Color backgroundColor = Colors.blueGrey,
- Color? voteCastedBackgroundColor = Colors.grey,
- Color? onVoteBackgroundColor = Colors.blue,
- TextStyle? leadingPollStyle,
- TextStyle? pollStyle,
- Color? iconColor = Colors.black,
- Color? leadingBackgroundColor = Colors.blueGrey,
- double optionBarRadius = 16,
- double borderWidth = .25,
- double optionHeight = 35,
- 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);