MessageOptions class Customization

Constructors

MessageOptions({bool showCurrentUserAvatar = false, bool showOtherUsersAvatar = true, bool showOtherUsersName = true, Widget userNameBuilder(ChatUser user)?, Widget avatarBuilder(ChatUser, Function? onPressAvatar, Function? onLongPressAvatar)?, dynamic onPressAvatar(ChatUser)?, dynamic onLongPressAvatar(ChatUser)?, dynamic onLongPressMessage(ChatMessage)?, dynamic onPressMessage(ChatMessage)?, dynamic onPressMention(Mention)?, Color? currentUserContainerColor, Color? currentUserTextColor, Color? containerColor, Color? textColor, EdgeInsets? messagePadding, double? maxWidth, BoxDecoration messageDecorationBuilder(ChatMessage message, ChatMessage? previousMessage, ChatMessage? nextMessage)?, Widget top(ChatMessage message, ChatMessage? previousMessage, ChatMessage? nextMessage)?, Widget bottom(ChatMessage message, ChatMessage? previousMessage, ChatMessage? nextMessage)?, Widget messageRowBuilder(ChatMessage message, ChatMessage? previousMessage, ChatMessage? nextMessage, bool isAfterDateSeparator, bool isBeforeDateSeparator, bool isSameAuthorSinglePost)?, Widget messageTextBuilder(ChatMessage message, ChatMessage? previousMessage, ChatMessage? nextMessage)?, List<MatchText>? parsePatterns, bool textBeforeMedia = true, void onTapMedia(ChatMedia media)?, bool showTime = false, DateFormat? timeFormat, Widget messageTimeBuilder(ChatMessage message, bool isOwnMessage)?, Widget messageMediaBuilder(ChatMessage message, ChatMessage? previousMessage, ChatMessage? nextMessage)?, bool isSameAuthorSinglePost = false})
const

Properties

avatarBuilder Widget Function(ChatUser, Function? onPressAvatar, Function? onLongPressAvatar)?
Builder to create your own avatar You can use DefaultAvatar to only override some varibales
final
bottom Widget Function(ChatMessage message, ChatMessage? previousMessage, ChatMessage? nextMessage)?
A widget to show under the chat bubble
final
containerColor Color?
Color of the other users chat bubbles Default to Colors.grey100
final
currentUserContainerColor Color?
Color of the current user chat bubbles Default to primary color
final
currentUserTextColor Color?
Color of the current user text in chat bubbles Default to white
final
hashCode int
The hash code for this object.
no setterinherited
isSameAuthorSinglePost bool
If the previous message is from the same author as the current one, display each message individually
final
maxWidth double?
Max message width Default to: null, MediaQuery.of(context).size.width * 0.7
final
messageDecorationBuilder BoxDecoration Function(ChatMessage message, ChatMessage? previousMessage, ChatMessage? nextMessage)?
To create your own BoxDecoration fot the chat bubble You can use defaultMessageDecoration to only override some variables
final
messageMediaBuilder Widget Function(ChatMessage message, ChatMessage? previousMessage, ChatMessage? nextMessage)?
Builder to create your own media container widget
final
messagePadding EdgeInsets?
Padding arround the message Default to: EdgeInsets.all(11)
final
messageRowBuilder Widget Function(ChatMessage message, ChatMessage? previousMessage, ChatMessage? nextMessage, bool isAfterDateSeparator, bool isBeforeDateSeparator, bool isSameAuthorSinglePost)?
Builder to create the entire message row yourself
final
messageTextBuilder Widget Function(ChatMessage message, ChatMessage? previousMessage, ChatMessage? nextMessage)?
Builder to create own message text widget
final
messageTimeBuilder Widget Function(ChatMessage message, bool isOwnMessage)?
Builder to create your own time widget (shown under the text when showTime is true)
final
onLongPressAvatar → dynamic Function(ChatUser)?
Function to call when the user long press on an avatar
final
onLongPressMessage → dynamic Function(ChatMessage)?
Function to call when the user long press on a message
final
onPressAvatar → dynamic Function(ChatUser)?
Function to call when the user press on an avatar
final
onPressMention → dynamic Function(Mention)?
Function to call when the user press on a message mention
final
onPressMessage → dynamic Function(ChatMessage)?
Function to call when the user press on a message
final
onTapMedia → void Function(ChatMedia media)?
Function to call when the user clicks on a media Will not work with the default video player
final
parsePatterns List<MatchText>?
List of MatchText using flutter_parsed_text library to parse and customize accordingly some part of the text By default ParsedType.URL is set and will use launchUrl to open the link
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showCurrentUserAvatar bool
If you want to show the avatar of the current user
final
showOtherUsersAvatar bool
If you want to show the avatar of the other users
final
showOtherUsersName bool
If you want to show the name of the other users above the messages Usefull in group chats
final
showTime bool
If you want to show the time under the text of each message
final
textBeforeMedia bool
When a message have both an text and a list of media it will determine which one th show first
final
textColor Color?
Color of the other users text in chat bubbles Default to black
final
timeFormat → DateFormat?
Format of the time if showTime is true Default to: DateFormat('HH:mm')
final
top Widget Function(ChatMessage message, ChatMessage? previousMessage, ChatMessage? nextMessage)?
A widget to show above the chat bubble
final
userNameBuilder Widget Function(ChatUser user)?
If you want to create your own userName widget when showOtherUsersName is true You can use DefaultUserName to only override some variables
final

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