Skip to content

feat: ✨ Add headerSlivers support to ChatList for advanced pinned headers#429

Open
KiddoV wants to merge 3 commits intoSimformSolutionsPvtLtd:mainfrom
KiddoV:main
Open

feat: ✨ Add headerSlivers support to ChatList for advanced pinned headers#429
KiddoV wants to merge 3 commits intoSimformSolutionsPvtLtd:mainfrom
KiddoV:main

Conversation

@KiddoV
Copy link

@KiddoV KiddoV commented Jan 29, 2026

Summary

This PR adds a new optional headerSlivers parameter to ChatList, allowing consumers to provide multiple slivers (e.g. SliverAppBar, SliverPersistentHeader) before the chat list. This make the ChatList more customizable.

Checklist

  • The title of my PR starts with a Conventional Commit prefix (fix:, feat:, docs: etc).
  • I have followed the Contributor Guide when preparing my PR.
  • I have updated/added tests for ALL new/updated/fixed functionality.
  • I have updated/added relevant documentation in docs and added dartdoc comments with ///.
  • I have updated/added relevant examples in examples or docs.

Breaking Change?

  • Yes, this PR is a breaking change.
  • No, this PR is not a breaking change.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 headerSlivers on ChatList.
  • Rendered headerSlivers in CustomScrollView.slivers before the existing header.
  • 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.
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants