avatar property

  1. @override
ImageProvider<Object>? avatar
final

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 initial letter of the author's name.

Defaults to null.

Example:

@override
Widget build(BuildContext context) {
 return SfChat(
   messages: [
     ChatMessage(
       author: ChatAuthor(
         avatar: NetworkImage('https://example.com/outgoing-avatar.jpg')
       ),
     ),
   ],
 );
}

Implementation

@override
final ImageProvider? avatar;