Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
Rendering issue in attached image preview when sending message on web.
* **Feat**: [420](https://github.com/SimformSolutionsPvtLtd/chatview/pull/420) Added support for
`playerMode` in `VoiceMessageConfiguration` with `single` and `multi`.
* **Feat**: [429](https://github.com/SimformSolutionsPvtLtd/chatview/pull/429) Added optional `headerSlivers`
to `ChatList` for better customization.

## [3.0.0]

Expand Down
8 changes: 8 additions & 0 deletions lib/src/widgets/chat_list/chat_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class ChatList extends StatefulWidget {
this.chatBuilder,
this.appbar,
this.loadMoreChats,
this.headerSlivers,
this.header,
this.footer,
this.isLastPage,
Expand Down Expand Up @@ -83,6 +84,12 @@ class ChatList extends StatefulWidget {
/// If set to `true`, pagination will not trigger loading more chats.
final ValueGetter<bool>? isLastPage;

/// List of sliver headers to be displayed at the top of the chat list.
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

headerSlivers is typed as List<Widget>, but CustomScrollView.slivers only accepts widgets that build a RenderSliver. If a consumer passes a regular box widget (e.g. Container) it will throw at runtime. Consider tweaking the dartdoc to explicitly state each entry must be a sliver widget (or should be wrapped in SliverToBoxAdapter) to avoid misuse.

Suggested change
/// List of sliver headers to be displayed at the top of the chat list.
/// List of sliver headers to be displayed at the top of the chat list.
///
/// Each widget in this list must be a sliver widget that builds a
/// [RenderSliver] (e.g. [SliverAppBar], [SliverPersistentHeader],
/// [SliverList], etc.). If you want to use a regular box widget
/// (such as [Container] or [SizedBox]) as a header, wrap it in a
/// [SliverToBoxAdapter] before adding it to this list. These widgets
/// are inserted into the [CustomScrollView.slivers] used by [ChatList].

Copilot uses AI. Check for mistakes.
///
/// Each widget in this list must be a sliver widget that builds a
/// [RenderSliver] (e.g. [SliverAppBar], [SliverPersistentHeader], etc.)
final List<Widget>? headerSlivers;

/// Header widget to be displayed at the top of the chat list.
final Widget? header;

Expand Down Expand Up @@ -179,6 +186,7 @@ class _ChatListState extends State<ChatList> {
),
),
),
...?widget.headerSlivers,
if (widget.header case final header?) SliverToBoxAdapter(child: header),
StreamBuilder<List<ChatListItem>>(
stream: _controller.chatListStream,
Expand Down