ChatTile class

A customizable chat bubble widget for messaging interfaces.

This widget creates chat message bubbles with support for avatars, titles, actions, and flexible styling. Perfect for chat applications, messaging interfaces, and conversation displays.

Features:

  • Left/right alignment for sent/received messages
  • Avatar/icon support (leading/trailing)
  • Optional title for sender name
  • Action buttons below message
  • Customizable styling and colors
  • Flexible padding and spacing
  • Theme-based default styling
  • Reverse mode for message direction

Example:

ChatTile(
  Text("Hello! How are you?"),
  leading: CircleAvatar(
    child: Text("JS"),
  ),
  title: Text("John Smith"),
  backgroundColor: Colors.grey[100],
  mainAxisAlignment: MainAxisAlignment.start,
)

メッセージングインターフェース用のカスタマイズ可能なチャット吹き出しウィジェット。

このウィジェットはアバター、タイトル、アクション、柔軟なスタイリングをサポートする チャットメッセージバブルを作成します。チャットアプリケーション、メッセージング インターフェース、会話表示に最適です。

特徴:

  • 送信/受信メッセージの左右配置
  • アバター/アイコンサポート(leading/trailing)
  • 送信者名のオプションタイトル
  • メッセージ下部のアクションボタン
  • カスタマイズ可能なスタイリングとカラー
  • 柔軟なパディングと間隔
  • テーマベースのデフォルトスタイリング
  • メッセージ方向のリバースモード

例:

ChatTile(
  Text("こんにちは!元気ですか?"),
  leading: CircleAvatar(
    child: Text("田中"),
  ),
  title: Text("田中太郎"),
  backgroundColor: Colors.grey[100],
  mainAxisAlignment: MainAxisAlignment.start,
)
Inheritance
Annotations

Constructors

ChatTile(Widget label, {Key? key, Color? backgroundColor, Color? foregroundColor, TextStyle? textStyle, List<Widget> actions = const [], Widget? leading, Widget? trailing, BorderRadiusGeometry? borderRadius, EdgeInsetsGeometry padding = const EdgeInsets.symmetric(vertical: 4), EdgeInsetsGeometry contentPadding = const EdgeInsets.all(16), MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start, CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.start, double space = 4, Widget? title, bool reverse = false, Widget? bottom})
A customizable chat bubble widget for messaging interfaces.
const

Properties

actions List<Widget>
Action to be placed below the body of the chat.
final
backgroundColor Color?
Background color.
final
borderRadius BorderRadiusGeometry?
Rounded corners for chat containers.
final
bottom Widget?
Widget to be displayed at the bottom of the chat container.
final
contentPadding EdgeInsetsGeometry
Padding inside the chat container.
final
crossAxisAlignment CrossAxisAlignment
Alignment of the chat container.
final
foregroundColor Color?
Color of text and icons.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
label Widget
Body of chat.
final
leading Widget?
Icon to be placed on the left side of the chat container.
final
mainAxisAlignment MainAxisAlignment
Alignment of the chat container.
final
padding EdgeInsetsGeometry
Padding throughout the chat.
final
reverse bool
If true, reverse the orientation.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
space double
Space between chat containers.
final
textStyle TextStyle?
Text Style.
final
title Widget?
Widget to be displayed in the title section.
final
trailing Widget?
Icon to be placed on the right side of the chat container.
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
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