MessageElement class abstract

A piece of content inside a Message, such as text, an image or a file.

Extend this class for each content type your chat supports:

class TextElement extends MessageElement {
  const TextElement(this.text);
  final String text;

  @override
  Widget toWidget(BuildContext context) => Text(text);

  @override
  TextElement copyWith() => TextElement(text);
}

Constructors

MessageElement()
Const constructor for subclasses.
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

copyWith() → MessageElement
Returns a copy of this element.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited
toWidget(BuildContext context) → Widget
Builds the widget for this element, shown inside the message bubble.

Operators

operator ==(Object other) → bool
The equality operator.
inherited