StreamEmojiChip class
A pill-shaped chip for displaying emoji reactions with an optional count.
StreamEmojiChip renders one or more emojis alongside an optional reaction count. Use the default constructor for a single-emoji chip, StreamEmojiChip.cluster for a multi-emoji chip, and StreamEmojiChip.addEmoji for the add-reaction button variant.
All variants share the same theming and support hover, press, selected, and disabled interaction states.
{@tool snippet}
Display a single-emoji reaction chip:
StreamEmojiChip(
emoji: StreamUnicodeEmoji('👍'),
count: 3,
isSelected: true,
onPressed: () => toggleReaction('👍'),
)
{@end-tool}
{@tool snippet}
Display a clustered chip with multiple emojis and a total count:
StreamEmojiChip.cluster(
emojis: [StreamUnicodeEmoji('👍'), StreamUnicodeEmoji('❤️'), StreamUnicodeEmoji('😂')],
count: 12,
onPressed: () => showReactionDetails(),
)
{@end-tool}
{@tool snippet}
Display an add-reaction chip:
StreamEmojiChip.addEmoji(
onPressed: () => showReactionPicker(),
)
{@end-tool}
See also:
- StreamEmojiChipTheme, for customizing chip appearance.
- StreamEmojiButton, for a circular emoji-only button.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- StreamEmojiChip
Constructors
- StreamEmojiChip({Key? key, required StreamEmojiContent emoji, int? count, VoidCallback? onPressed, VoidCallback? onLongPress, bool isSelected = false})
-
Creates a single-emoji chip displaying
emojiand an optionalcount. -
StreamEmojiChip.cluster({Key? key, required List<
StreamEmojiContent> emojis, int? count, VoidCallback? onPressed, VoidCallback? onLongPress, bool isSelected = false}) -
Creates a clustered chip displaying multiple
emojisand an optionalcount.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- props → StreamEmojiChipProps
-
The props controlling the appearance and behavior of this chip.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
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
Static Methods
-
addEmoji(
{Key? key, VoidCallback? onPressed, VoidCallback? onLongPress}) → Widget - Creates an add-emoji chip showing the add-reaction icon.
-
overflow(
{Key? key, required int count, VoidCallback? onPressed, VoidCallback? onLongPress}) → Widget -
Creates an overflow chip displaying a
+Ncount label.