Polls class
- Inheritance
Constructors
-
Polls({required List children, required Map? voteData, required String? currentUser, required String? creatorID, List<
UserInteraction> ? pollVoteData, Text? question, int? userChoice, bool allowCreatorVote = false, PollCallBack? onVote, Color outlineColor = Colors.blue, Color backgroundColor = Colors.white, Color? onVoteBackgroundColor = Colors.white, TextStyle? onVotePollStyle, TextStyle? leadingPollStyle, TextStyle? pollStyle, Color? iconColor = Colors.black, Color? lowestBackgroundColor = Colors.blueGrey, TextStyle? lowestPollStyle}) - Polls contruct by default get view for voting
-
Polls.castVote({required List children, required PollCallBack? onVote, List<
UserInteraction> ? pollVoteData, Text? question, bool allowCreatorVote = false, Color outlineColor = Colors.blue, Color backgroundColor = Colors.white, TextStyle? pollStyle, TextStyle? onVotePollStyle, TextStyle? lowestPollStyle}) - this creates view for users to cast votes
-
Polls.creator({required List children, Text? question, TextStyle? leadingPollStyle, TextStyle? pollStyle, Color backgroundColor = Colors.white, Color? lowestBackgroundColor = Colors.blueAccent, Color? onVoteBackgroundColor = Colors.white, bool allowCreatorVote = false, TextStyle? lowestPollStyle, List<
UserInteraction> ? pollVoteData, TextStyle? onVotePollStyle}) - This creates view for the creator of the polls
-
Polls.viewPolls({required List children, Text? question, int? userChoice, TextStyle? leadingPollStyle, TextStyle? pollStyle, Color backgroundColor = Colors.white, Color? lowestBackgroundColor = Colors.blueAccent, Color? onVoteBackgroundColor = Colors.white, Color? iconColor = Colors.black, TextStyle? lowestPollStyle, List<
UserInteraction> ? pollVoteData, TextStyle? onVotePollStyle}) - creates view for see polls result
Properties
- allowCreatorVote → bool
-
determines if the creator of the poll can vote or not
final
- backgroundColor → Color
-
final
- children → List
-
takes in poll options array
final
- creatorID → String?
-
final
- currentUser → String?
-
final
- getlowest → PollTotal?
-
returns lowest votes casted
final
- getTotal → PollTotal?
-
returns total votes casted
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- iconColor → Color?
-
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- leadingPollStyle → TextStyle?
-
final
- lowest → double?
-
final
- lowestBackgroundColor → Color?
-
final
- lowestPollStyle → TextStyle?
-
final
- onVote → PollCallBack?
-
call back returns user choice after voting
final
- onVoteBackgroundColor → Color?
-
final
- onVotePollStyle → TextStyle?
-
final
- outlineColor → Color
-
colors setting for polls widget
final
- pollStyle → TextStyle?
-
style
final
-
pollVoteData
→ List<
UserInteraction> ? -
final
- question → Text?
-
takes the question on the poll
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- userChoice → int?
-
is takes in current user choice
final
- viewType ↔ PollsType?
-
determines what type of view user should see
if its creator, or view requiring you to vote or view showing your vote
getter/setter pair
- voteData → Map?
-
takes in vote data which should be a Map
with polls widget determines what type of view the user should see
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → _PollsState -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of
DiagnosticsNode
objects describing this node's children.inherited -
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited