BubbleConfiguration class
Appearance options for message bubbles, profiles and timestamps.
Passed to Chat through ChatConfiguration.bubbleConfiguration.
Every builder is optional; when one is null a simple default is used.
Constructors
- BubbleConfiguration({Widget senderProfileBuilder(BuildContext context, String name)?, Widget receiverProfileBuilder(BuildContext context, String name)?, Widget senderBubbleBuilder(BuildContext context, Widget child)?, Widget receiverBubbleBuilder(BuildContext context, Widget child)?, Widget timeBuilder(BuildContext context, String name)?, Widget loadingWidget = const MessageLoading(), double maxWidth = double.infinity, EdgeInsetsGeometry? padding = const EdgeInsets.all(16), TextStyle? profileNameStyle, TextStyle? timeStyle, Widget readIndicatorBuilder(BuildContext context, bool isRead)?})
-
Creates a BubbleConfiguration.
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- loadingWidget → Widget
-
Widget shown inside a bubble while its message is being sent
(Message.isLoading is
true).final - maxWidth → double
-
Maximum width of a bubble.
final
-
Context menu opened by a long press or a right click on a bubble.
Sender and receiver menus are configured separately.
nulldisables it.final - padding → EdgeInsetsGeometry?
-
Inner padding of the default bubbles.
final
- profileNameStyle → TextStyle?
-
Text style for the name in the profile.
final
- readIndicatorBuilder → Widget Function(BuildContext context, bool isRead)?
-
Builds a read/unread indicator beside a bubble.
final
- receiverBubbleBuilder → Widget Function(BuildContext context, Widget child)?
-
Wraps the content of a receiver message in a bubble.
final
- receiverProfileBuilder → Widget Function(BuildContext context, String name)?
-
Builds the profile shown next to a group of receiver messages.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- senderBubbleBuilder → Widget Function(BuildContext context, Widget child)?
-
Wraps the content of a sender message in a bubble.
final
- senderProfileBuilder → Widget Function(BuildContext context, String name)?
-
Builds the profile shown next to a group of sender messages.
final
- timeBuilder → Widget Function(BuildContext context, String name)?
-
Builds the timestamp shown beside the last bubble of a group.
final
- timeStyle → TextStyle?
-
Text style for the timestamp.
final
Methods
-
buildBubble(
BuildContext context, Widget child, bool isSender) → Widget -
Wraps
childin a bubble, using senderBubbleBuilder or receiverBubbleBuilder depending onisSender, or the default bubble. -
buildProfile(
BuildContext context, String name, bool isSender) → Widget -
Builds the profile for a group, using senderProfileBuilder or
receiverProfileBuilder depending on
isSender, or the default profile. -
buildTime(
BuildContext context, String timestamp) → Widget - Builds the timestamp widget with timeBuilder or the default format.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited