Channel Page Config
ChannelPage accepts ChannelConfig for channel-list styling and built-in behavior. The config is intentionally narrow: it controls the built-in app bar, list loading, channel item presentation, long-press menu, and swipe action style. Page-level interactions such as routing, analytics, and custom action handling are supplied through ChannelPage callbacks.
Entry Point
ChannelPage(
config: ChannelConfig(
appBarConfig: ChannelAppBarConfig(title: 'Messages'),
listConfig: ChannelListConfig(showSearchBar: true),
itemConfig: ChannelItemConfig(showReadStatus: true),
),
)
ChannelConfig
ChannelConfig contains five sections:
appBarConfig: built-in page app bar.listConfig: list behavior, paging, filters, and background.itemConfig: built-in row visibility, colors, text styles, avatar behavior, and item-level builders.profileProvider: shared lightweight profile resolver for built-in channel rows and the defaultChatPageopened from the channel list.longPressMenuConfig: built-in long-press menu style.
Navigation priority
When a channel item is tapped, the page resolves navigation in this order:
| Priority | API | Behavior |
|---|---|---|
| 1 | ChannelPage.onItemTap | Full host-app ownership of the tap. Use this for custom routing, analytics, or permission checks. |
| 2 | ChannelPage.chatPageOpener | Uses a custom opener while keeping the built-in item tap flow. |
| 3 | ChannelListConfig.itemTapBehavior | openChatPage opens ChatPage; none disables built-in navigation. |
Use onChannelAction for pin, mute, and delete confirmation flows. Use ChannelConfig for how those actions are shown.
ChannelAppBarConfig
Fields:
height: app bar height.title: title text.centerTitle: whether the title is centered.backgroundColor: app bar background color.titleTextStyle: title style.titleSpacing: title spacing passed to the app bar.actions: trailing widgets.
Example:
ChannelPage(
config: const ChannelConfig(
appBarConfig: ChannelAppBarConfig(
title: 'Messages',
centerTitle: true,
backgroundColor: Colors.white,
),
),
)
ChannelListConfig
Fields:
showSearchBar: shows the built-in search row.showNetworkStatusTip: shows the built-in network status tip when needed.emptyText: fallback empty-state text.backgroundColor: list background color.channelTypes: channel types used by the defaultChannelProvider.pageSize: page size forChannelsQuery; valid range is1...50.itemTapBehavior:ChannelItemTapBehavior.openChatPageopensChatPage;ChannelItemTapBehavior.noneleaves the tap to your callbacks.
Example:
ChannelPage(
config: const ChannelConfig(
listConfig: ChannelListConfig(
showSearchBar: true,
pageSize: 30,
channelTypes: [ChannelType.direct, ChannelType.group],
itemTapBehavior: ChannelItemTapBehavior.openChatPage,
),
),
)
ChannelItemConfig
Visibility fields:
showUnreadBadgeshowLastMessageshowTimeshowPinnedIndicatorshowDirectChannelOnlineStatusshowReadStatusshowNotificationLevelIndicator
Avatar and profile fields:
avatarRadiusavatarShape:ChannelAvatarShape.circle,roundedRectangle, orrectangle.useDefaultAvatarAssetdisplayProfileResolverdisplayProfilesdirectChannelAvatarAssetNamegroupChannelAvatarAssetNamesystemChannelAvatarAssetName
ChannelConfig.profileProvider can be used when the same app-owned profile source should drive both the channel list row and the default chat page. Channel row priority is:
ChannelItemConfig.displayProfilesChannelItemConfig.displayProfileResolverChannelConfig.profileProvider- Built-in fallback display
When ChannelPage opens the default ChatPage, ChannelConfig.profileProvider is passed through to ChatPageConfig.profileProvider and is also used as a fallback for the default chat title. If you provide a custom chatPageOpener or onItemTap, your app owns the target page configuration.
Style fields:
titleStylelastMessageStyletimeStyledividerColordividerIndentdividerEndIndentdividerHeightbackgroundColorpinnedBackgroundColorlongPressBackgroundColor
Callback and builder fields:
onlineStatusProvideronlineStatusBuilderreadStatusBuildernotificationLevelBuilderavatarBuildertitleBuilderlastMessageBuildertimeBuilderunreadBadgeBuilder
Swipe actions:
swipeActionsConfig: aChannelSwipeActionsConfigvalue for built-in row actions.
Example:
ChannelPage(
config: ChannelConfig(
profileProvider: (channel, {message}) async {
final userId = message?.senderUserId ?? channel.channelId;
final profile = await accountRepository.loadUser(userId);
return ChatProfileInfo(
id: userId,
name: profile?.displayName,
portraitUri: profile?.avatarUrl,
);
},
itemConfig: ChannelItemConfig(
showDirectChannelOnlineStatus: true,
showReadStatus: true,
avatarShape: ChannelAvatarShape.circle,
titleStyle: const TextStyle(fontWeight: FontWeight.w600),
displayProfileResolver: (context, channel) async {
return const ChannelDisplayProfile(displayName: 'Support');
},
),
),
)
ChannelSwipeActionsConfig
Fields:
enabled: enables or disables built-in swipe actions.actionWidth: width for each action.revealThreshold: drag threshold from0to1.actions: orderedChannelActionTypevalues.labels: labels by action type.icons: icons by action type.backgroundColors: background colors by action type.foregroundColor: icon and label color.
Example:
ChannelItemConfig(
swipeActionsConfig: ChannelSwipeActionsConfig(
actions: [ChannelActionType.mute, ChannelActionType.delete],
labels: {
ChannelActionType.mute: 'Mute',
ChannelActionType.delete: 'Remove',
},
),
)
ChannelLongPressMenuConfig
Fields:
backgroundColorshapewidthiconSizeiconColorpaddingitemHeightitemPaddingitemMarginactionTextStyledestructiveTextStylecancelTextshowCancel
Example:
ChannelPage(
config: const ChannelConfig(
longPressMenuConfig: ChannelLongPressMenuConfig(
width: 180,
showCancel: true,
),
),
)
Use page-level builders when the built-in row structure is not enough. See Channel page builders.