avatar property

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 intial 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

final ImageProvider? avatar;