Skip to content

Missing API for Upward Pagination / Loading Message History (onLoadMore) #3

@herve2000

Description

@herve2000

Hello Team,

I'm using the flutter_chatflow package (version 2.0.2) to implement a chat feature, and it's a great tool for chat UI development.

I'd like to bring up a point regarding the handling of upward pagination (loading older messages when the user scrolls up).

The Problem:
The API for the main ChatFlow widget does not appear to expose a direct mechanism for detecting when the user reaches the top of the message list to load the next batch of history.

Absence of onLoadMore: There is no exposed callback property (such as onLoadMore or equivalent) that is automatically triggered when the widget's internal ScrollController hits the top of the list.

Scroll Control: The internal ScrollController is not exposed, which prevents manually integrating a ScrollListener or using a NotificationListener around ChatFlow.

Impact:
Without an exposed scroll-to-top event, the only remaining solution is to load older messages manually (e.g., via a "Load History" button or complex external logic). This approach is less fluid and doesn't match the modern chat user experience (like on WhatsApp or Telegram).

Suggestion:
To allow for smooth and efficient handling of message history (infinite upward pagination), I suggest adding a property to the ChatFlow widget's API:

Dart

ChatFlow({
// ... existing properties
Future Function()? onLoadMore, // or onFetchOlderMessages
// ...
})
This function should be called by the ChatFlow widget when the user reaches the first message in the list, signaling the application to fetch and insert new messages at the beginning of the provided list.

Thank you very much for considering this suggestion. I'm available if you need further details or testing.

Best regards,

herve2000

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions