Skip to content
On this page

MessageBubble

A message container with sender-aware layout and styling.

MessageBubble in FluttyUIMessageBubble in FluttyUI dark theme

Import

import 'package:flutter/widgets.dart';
import 'package:fluttyui/fluttyui.dart' as ui;

API Reference

The declarations below match the current FluttyUI source. Types are shown without the optional ui. import prefix.

MessageBubble

const MessageBubble({
  super.key,
  required this.child,
  this.size,
  this.role = MessageRole.assistant,
  this.position = MessageBubblePosition.single,
  this.filled,
  this.maxWidth = 680,
  this.sender,
  this.timestamp,
  this.avatar,
  this.delivery,
  this.actions,
  this.footer,
  this.backgroundColor,
  this.padding,
  this.onLongPress,
  this.onLongPressStart,
});
ParameterTypeRequiredDefault
keyKey?Nonull
childWidgetYes—
sizeComponentSize?Nonull
roleMessageRoleNoMessageRole.assistant
positionMessageBubblePositionNoMessageBubblePosition.single
filledbool?Nonull
maxWidthdoubleNo680
senderString?Nonull
timestampString?Nonull
avatarWidget?Nonull
deliveryMessageDelivery?Nonull
actionsWidget?Nonull
footerWidget?Nonull
backgroundColorColor?Nonull
paddingEdgeInsetsGeometry?Nonull
onLongPressVoidCallback?Nonull
onLongPressStartGestureLongPressStartCallback?Nonull

Application Setup

Place components under FluttyApp to provide theme, navigation, localization, and overlay defaults. Use theme tokens for shared appearance settings.

Source

lib/src/widgets/messaging/message_bubble/message_bubble.dart

This reference is generated from the MessageBubble declaration in the FluttyUI core checkout. The component catalog lists the other available building blocks.

DartFlutter

Get started with FluttyUI