Polls class
- Inheritance
Constructors
- Polls({required List children, required Text question, required Map? voteData, required String? currentUser, required String? creatorID, int? userChoice, bool allowCreatorVote = false, PollCallBack? onVote, Color outlineColor = Colors.blue, Color backgroundColor = Colors.blueGrey, Color? onVoteBackgroundColor = Colors.blue, TextStyle? leadingPollStyle, TextStyle? pollStyle, Color? iconColor = Colors.black, Color? leadingBackgroundColor = Colors.blueGrey})
- Polls contruct by default get view for voting
- Polls.castVote({required List children, required Text question, required PollCallBack? onVote, bool allowCreatorVote = false, Color outlineColor = Colors.blue, Color backgroundColor = Colors.blueGrey, TextStyle? pollStyle})
- this creates view for users to cast votes
- Polls.creator({required List children, required Text question, TextStyle? leadingPollStyle, TextStyle? pollStyle, Color backgroundColor = Colors.blue, Color? leadingBackgroundColor = Colors.blueAccent, Color? onVoteBackgroundColor = Colors.blueGrey, bool allowCreatorVote = false})
- This creates view for the creator of the polls
- Polls.viewPolls({required List children, required Text question, int? userChoice, TextStyle? leadingPollStyle, TextStyle? pollStyle, Color backgroundColor = Colors.blue, Color? leadingBackgroundColor = Colors.blueAccent, Color? onVoteBackgroundColor = Colors.blueGrey, Color? iconColor = Colors.black})
- this creates view for see polls result
Properties
- allowCreatorVote → bool
-
this determines if the creator of the poll can vote or not
final
- backgroundColor → Color
-
final
- children → List
-
this takes in poll options array
final
- creatorID → String?
-
final
- currentUser → String?
-
final
- getHighest → PollTotal?
-
this returns highest votes casted
final
- getTotal → PollTotal?
-
this returns total votes casted
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- highest → double?
-
final
- iconColor → Color?
-
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- leadingBackgroundColor → Color?
-
final
- leadingPollStyle → TextStyle?
-
final
- onVote → PollCallBack?
-
this call back returns user choice after voting
final
- onVoteBackgroundColor → Color?
-
final
- outlineColor → Color
-
colors setting for polls widget
final
- pollStyle → TextStyle?
-
style
final
- question → Text
-
this takes the question on the poll
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- userChoice → int?
-
this is takes in current user choice
final
- viewType → PollsType?
-
this determines what type of view user should see
if its creator, or view requiring you to vote or view showing your vote
final
- voteData → Map?
-
this takes in vote data which should be a Map
with this, 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