Improve scroll end
This commit is contained in:
parent
f256b1aee7
commit
96a8f41525
1 changed files with 11 additions and 6 deletions
|
@ -82,12 +82,17 @@ class _HomePageState extends State<HomePage> {
|
|||
itemCount: streamElements.length,
|
||||
controller: _scrollController,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
WidgetsBinding.instance!.addPostFrameCallback((timeStamp) {
|
||||
_scrollController.animateTo(
|
||||
_scrollController.position.maxScrollExtent,
|
||||
duration: const Duration(milliseconds: 500),
|
||||
curve: Curves.easeOut);
|
||||
});
|
||||
if (_scrollController.position.maxScrollExtent -
|
||||
_scrollController.offset <
|
||||
10) {
|
||||
WidgetsBinding.instance!
|
||||
.addPostFrameCallback((timeStamp) {
|
||||
_scrollController.animateTo(
|
||||
_scrollController.position.maxScrollExtent,
|
||||
duration: const Duration(milliseconds: 500),
|
||||
curve: Curves.easeOut);
|
||||
});
|
||||
}
|
||||
return StreamElementCard(
|
||||
streamElement: streamElements[index]);
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue