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
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- CometChatPollsBubble
Constructors
-
CometChatPollsBubble({Key? key, String? loggedInUser, String? pollQuestion, List<
PollOptions> ? options, String? pollId, CometChatTheme? theme, required Future<void> choosePoll(String vote, String id), String? senderUid, Map<String, dynamic> ? metadata, PollsBubbleStyle? style}) -
const
Properties
-
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 → PollsBubbleStyle?
-
final
- theme → CometChatTheme?
-
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
-
getPollBar(
int index, String id, List< PollOptions> options, int totalVote, String chosenId, String pollId, CometChatTheme theme) → Widget -
getPollResultWidget(
List< PollOptions> options, int totalVote, String chosenId, String pollId, CometChatTheme theme) → dynamic -
getPollWidget(
List< PollOptions> options, String chosenId, String pollId, CometChatTheme theme) → Widget -
getRadio(
int index, String id, String value, String chosenId, String pollId, CometChatTheme theme) → dynamic -
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