Comments (3)
Hey, you don't need to create a custom scrollController listener like suggested by @LegendAF. You can achieve the same by using onLoadEarlier
from MessageListOptions
and add your logic to fetch more messages and append them to the list of existing messages.
Let me know if you have more questions regarding the pagination
from dash-chat-2.
You will want to pass in a scroll controller to MessageListOptions(scrollController: _scrollController);
From there listen to it _scrollController.addListener(_onScroll);
and do something like:
void _onScroll() {
if (!_fetchingMessages) {
// if the top is reached
if (_scrollController.offset >=
_scrollController.position.maxScrollExtent) {
setState(() {
_fetchingMessages = true;
});
// do things
...
// reset fetching
WidgetsBinding.instance.addPostFrameCallback((_) {
setState(() {
_fetchingMessages = false;
});
});
}
}
}
from dash-chat-2.
Closing this, let us know if you have more questions
from dash-chat-2.
Related Issues (20)
- Please update to intl ^0.19.0 HOT 3
- Can't scroll using arrow keys after we tap on dashchat
- Update Message status
- [bug] on avatar pressed customProperties always return null even i have data in firebase HOT 2
- Fontsize Up HOT 6
- Multiline input doesn't expand HOT 1
- How to implement message copy on long press HOT 2
- Bump video_player dependence HOT 1
- Did dash_chat_2 0.0.20 supports sendbird_chat_sdk v4 ? HOT 2
- Custom component does not display chat messages behind it after setting transparency
- Wrong datetime HOT 1
- Documentation HOT 1
- How to enable image upload option HOT 1
- Conflict between cached_video_player and dash_chat_2 HOT 1
- Error while running Flutter project using package. HOT 1
- update intl to ^0.19.0 HOT 1
- ใHelpใHow do I get a user to always show an avatar in the chat list?
- Adding Reactions: Enhancement
- Use of arrow key to scroll chats HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dash-chat-2.