messageContent method
Implementation
Widget messageContent(ChatMessage message) {
/// check message type and render the right widget
if (message.chatMedia == null) {
/// render text message
return TextMessageWidget(
message: message,
senderColor: senderColor,
);
} else {
return message.chatMedia!.mediaType.maybeWhen(
imageMediaType: () => ImageMessageWidget(
message: message,
senderColor: senderColor,
messageContainerTextStyle: messageContainerTextStyle,
),
audioMediaType: () => AudioMessageWidget(
message: message,
senderColor: senderColor,
activeAudioSliderColor: activeAudioSliderColor,
inActiveAudioSliderColor: inActiveAudioSliderColor,
),
//TODO add this
videoMediaType: () => Container(),
orElse: () => TextMessageWidget(
message: message,
senderColor: senderColor,
));
}
}