CometChatPollsBubble class

CometChatPollsBubble is a widget that is rendered as the content view for PollsExtension

CometChatPollsBubble(
 pollQuestion: "What is your favorite color?",
 options: [
   PollOptions(id: "1", optionText: "Red"),
   PollOptions(id: "2", optionText: "Green"),
   PollOptions(id: "3", optionText: "Blue")
 ],
 pollId: "123456",
 choosePoll: (String vote, String id) async {
   // Code to handle the poll vote
 },
);

Inheritance

Constructors

CometChatPollsBubble({Key? key, String? loggedInUser, String? pollQuestion, List<PollOptions>? options, String? pollId, required Future<void> choosePoll(String vote, String id), String? senderUid, Map<String, dynamic>? metadata, BubbleAlignment? alignment, CometChatPollsBubbleStyle? style})
const

Properties

alignment BubbleAlignment?
alignment of the bubble used to set default colors for background and text
final
choosePoll Future<void> Function(String vote, String id)
choosePoll vote for 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
loggedInUser String?
loggedInUser logged in user id to check if logged user voted or not
final
metadata Map<String, dynamic>?
metadata metadata attached to the poll message
final
options List<PollOptions>?
options if options is passed then that is used instead of options from message Object
final
pollId String?
pollId if poll id is passed then that is used instead of poll id from message Object
final
pollQuestion String?
pollQuestion if poll question is passed then that is used instead of poll question from message Object
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
senderUid String?
senderUid uid of poll creator
final
style CometChatPollsBubbleStyle?
style style for the poll bubble
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<CometChatPollsBubble>
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, 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