feat: ✨ Add headerSlivers support to ChatList for advanced pinned headers#429
feat: ✨ Add headerSlivers support to ChatList for advanced pinned headers#429KiddoV wants to merge 3 commits intoSimformSolutionsPvtLtd:mainfrom
headerSlivers support to ChatList for advanced pinned headers#429Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new headerSlivers parameter to ChatList so consumers can insert multiple sliver-based headers (e.g., SliverAppBar, SliverPersistentHeader) above the chat list content for more advanced/pinned header layouts.
Changes:
- Introduced optional
headerSliversonChatList. - Rendered
headerSliversinCustomScrollView.sliversbefore the existingheader. - Documented the feature in
CHANGELOG.md.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| lib/src/widgets/chat_list/chat_list.dart | Adds headerSlivers API and spreads provided slivers into the CustomScrollView before the chat list. |
| CHANGELOG.md | Records the new headerSlivers feature in the Unreleased section. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| /// 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. |
There was a problem hiding this comment.
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.
| /// 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]. |
Summary
This PR adds a new optional
headerSliversparameter toChatList, allowing consumers to provide multiple slivers (e.g. SliverAppBar, SliverPersistentHeader) before the chat list. This make theChatListmore customizable.Checklist
fix:,feat:,docs:etc).docsand added dartdoc comments with///.examplesordocs.Breaking Change?