StreamPollInteractor class
A widget that allows users to interact with a poll.
The widget provides various callbacks to interact with the poll.
- onCastVote is called when the user wants to cast a vote.
- onRemoveVote is called when the user wants to remove a vote.
- onEndVote is called when the user wants to end the voting.
- onAddComment is called when the user wants to add a comment.
- onViewComments is called when the user wants to view all the comments.
- onViewResults is called when the user wants to view the poll results.
- onSuggestOption is called when the user wants to suggest an option.
- onSeeMoreOptions is called when the user wants to see more options.
The widget also provides a visibleOptionCount parameter to control the number of visible options in the poll. If null, all options will be visible.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- StreamPollInteractor
Constructors
-
StreamPollInteractor.new({Key? key, required Poll poll, required User currentUser, EdgeInsetsGeometry padding = const EdgeInsets.symmetric(vertical: 12, horizontal: 10), int? visibleOptionCount, ValueChanged<
PollOption> ? onCastVote, ValueChanged<PollVote> ? onRemoveVote, VoidCallback? onEndVote, VoidCallback? onAddComment, VoidCallback? onViewComments, VoidCallback? onViewResults, VoidCallback? onSuggestOption, VoidCallback? onSeeMoreOptions}) -
A widget that allows users to interact with a poll.
const
Properties
- currentUser → User
-
The current user interacting with the poll.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- onAddComment → VoidCallback?
-
Callback invoked when the user wants to add a comment.
final
-
onCastVote
→ ValueChanged<
PollOption> ? -
Callback invoked when the user wants to cast a vote.
final
- onEndVote → VoidCallback?
-
Callback invoked when the user wants to end the voting.
final
-
onRemoveVote
→ ValueChanged<
PollVote> ? -
Callback invoked when the user wants to remove a vote.
final
- onSeeMoreOptions → VoidCallback?
-
Callback invoked when the user wants to see more options.
final
- onSuggestOption → VoidCallback?
-
Callback invoked when the user wants to suggest an option.
final
- onViewComments → VoidCallback?
-
Callback invoked when the user wants to view all the comments.
final
- onViewResults → VoidCallback?
-
Callback invoked when the user wants to view the poll results.
final
- padding → EdgeInsetsGeometry
-
The padding to apply to the interactor.
final
- poll → Poll
-
The poll to interact with.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- visibleOptionCount → int?
-
The number of visible options in the poll.
final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
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, int wrapWidth = 65}) → 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