ChatAuthor class

Represents the author of a chat message.

The ChatAuthor class contains details about the person who sent the message, such as their unique ID, name, and optional avatar image.

Example:


@override
Widget build(BuildContext context) {
 return SfChat(
   messages: [
     ChatMessage(
       author: ChatAuthor(id: '123-001', name: 'Chat A'),
     ),
   ],
 );
}

Constructors

ChatAuthor({required String id, required String name, ImageProvider<Object>? avatar})
Creates a new ChatAuthor with the specified id, name, and optional avatar.
const

Properties

avatar ImageProvider<Object>?
Optional avatar image for the author. This field holds an optional image that represents the author. If no avatar is provided, the chat application will display the intial letter of the author's name.
final
hashCode int
The hash code for this object.
no setterinherited
id String
Unique identifier for the author.
final
name String
Name of the author.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

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