flutter_chat_core library
Flutter Chat Core package. Provides the core functionality for the flutter_chat_ui package.
Classes
- Builders
- A collection of builder functions used to customize the UI components of the chat interface.
- ChatColors
- Defines the color palette for the chat UI.
- ChatController
- Abstract interface for managing the state of chat messages.
- ChatOperation
- Represents a single operation performed on the message list managed by a ChatController.
- ChatTheme
- Defines the visual styling for the chat UI.
- ChatTypography
- Defines the typography styles used in the chat UI.
- DateFormat
- DateFormat is for formatting and parsing dates in a locale-sensitive manner.
- ImagePreviewData
- Represents the data extracted for a link preview image.
- InMemoryChatController
- A basic ChatController implementation that stores messages in memory.
- LinkPreviewData
- Represents the data extracted for a link preview.
- Message
- Base class for all message types.
- MessageGroupStatus
- Represents the grouping status of a message within a sequence of messages from the same author sent close together in time.
- User
- Represents a user in the chat system.
- UserCache
- A cache for storing resolved users to prevent flickering in recycled widgets.
Enums
- ChatOperationType
- Enum representing the type of operation performed on the chat message list.
- LinkPreviewPosition
- Enum controlling the position of the link preview widget.
- MessagesGroupingMode
- Defines the mode for grouping messages. Default is timeDifference.
- MessageStatus
- Represents the delivery status of a message.
- TimeAndStatusPosition
- Defines the position of the timestamp and status indicator relative to the message content.
Mixins
- ScrollToMessageMixin
- A mixin for ChatController implementations that adds programmatic scrolling capabilities.
- UploadProgressMixin
- A mixin for ChatController implementations that need to handle upload progress tracking for messages (e.g., images, files).
Extensions
- BuildersPatterns on Builders
- Adds pattern-matching-related methods to Builders.
- ChatColorsPatterns on ChatColors
- Adds pattern-matching-related methods to ChatColors.
- ChatThemeExtensions on ChatTheme
- Extension methods for ChatTheme to simplify modifications.
- ChatThemePatterns on ChatTheme
- Adds pattern-matching-related methods to ChatTheme.
- ChatTypographyPatterns on ChatTypography
- Adds pattern-matching-related methods to ChatTypography.
- ImagePreviewDataPatterns on ImagePreviewData
- Adds pattern-matching-related methods to ImagePreviewData.
- LinkPreviewDataPatterns on LinkPreviewData
- Adds pattern-matching-related methods to LinkPreviewData.
- MessagePatterns on Message
- Adds pattern-matching-related methods to Message.
- UserPatterns on User
- Adds pattern-matching-related methods to User.
Properties
- emojiRegex → RegExp
-
final
- whitespaceRegex → RegExp
-
final
Functions
-
getIconForStatus(
MessageStatus status) → IconData - Returns the appropriate IconData for a given MessageStatus.
-
isOnlyEmoji(
String text) → bool - Returns true if the given text contains only emojis and whitespace. Returns false if the text contains any non-emoji characters.
Typedefs
- AudioMessageBuilder = Widget Function(BuildContext, AudioMessage, int index, {MessageGroupStatus? groupStatus, required bool isSentByMe})
- Signature for building an audio message widget.
- ChatAnimatedListBuilder = Widget Function(BuildContext, ChatItem itemBuilder)
-
Signature for building the main chat list widget (e.g.,
ChatAnimatedList). -
ChatItem
= Widget Function(BuildContext context, Message message, int index, Animation<
double> animation, {bool? isRemoved, int? messageGroupingTimeoutInSeconds, MessagesGroupingMode? messagesGroupingMode}) -
Signature for a function that builds a single chat list item widget.
Used by
ChatAnimatedListandChatAnimatedListReversed. -
ChatMessageBuilder
= Widget Function(BuildContext, Message message, int index, Animation<
double> animation, Widget child, {MessageGroupStatus? groupStatus, bool? isRemoved, required bool isSentByMe}) - Signature for building the wrapper around each chat message item.
- ComposerBuilder = Widget Function(BuildContext)
- Signature for building the message composer widget.
- CustomMessageBuilder = Widget Function(BuildContext, CustomMessage, int index, {MessageGroupStatus? groupStatus, required bool isSentByMe})
- Signature for building a custom message widget.
- EmptyChatListBuilder = Widget Function(BuildContext)
- Signature for building the empty chat list widget.
- FileMessageBuilder = Widget Function(BuildContext, FileMessage, int index, {MessageGroupStatus? groupStatus, required bool isSentByMe})
- Signature for building a file message widget.
- ImageMessageBuilder = Widget Function(BuildContext, ImageMessage, int index, {MessageGroupStatus? groupStatus, required bool isSentByMe})
- Signature for building an image message widget.
- LinkPreviewBuilder = Widget? Function(BuildContext, TextMessage, bool isSendByMe)
- Signature for building the link preview widget.
- LoadMoreBuilder = Widget Function(BuildContext)
- Signature for building the loading indicator shown when fetching more messages.
- MessageID = String
- Alias for a message ID (String).
-
ResolveUserCallback
= Future<
User?> Function(UserID id) - Signature for a callback function that resolves a User object from a UserID.
-
ScrollToBottomBuilder
= Widget Function(BuildContext, Animation<
double> animation, VoidCallback onPressed) - Signature for building the "scroll to bottom" button.
-
ScrollToIndex
= Future<
void> Function(int index, {double alignment, Curve curve, Duration duration, double offset}) - Signature for a function that scrolls the chat list to a specific index.
-
ScrollToMessageId
= Future<
void> Function(MessageID messageId, {double alignment, Curve curve, Duration duration, double offset}) - Signature for a function that scrolls the chat list to a specific message ID.
- SystemMessageBuilder = Widget Function(BuildContext, SystemMessage, int index, {MessageGroupStatus? groupStatus, required bool isSentByMe})
- Signature for building a system message widget.
- TextMessageBuilder = Widget Function(BuildContext, TextMessage, int index, {MessageGroupStatus? groupStatus, required bool isSentByMe})
- Signature for building a text message widget.
- TextStreamMessageBuilder = Widget Function(BuildContext, TextStreamMessage, int index, {MessageGroupStatus? groupStatus, required bool isSentByMe})
- Signature for building a streaming text message widget.
- UnsupportedMessageBuilder = Widget Function(BuildContext, UnsupportedMessage, int index, {MessageGroupStatus? groupStatus, required bool isSentByMe})
- Signature for building an unsupported message widget.
- UserID = String
- Alias for a user ID (String).
- VideoMessageBuilder = Widget Function(BuildContext, VideoMessage, int index, {MessageGroupStatus? groupStatus, required bool isSentByMe})
- Signature for building a video message widget.