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,
|
itemCount: streamElements.length,
|
||||||
controller: _scrollController,
|
controller: _scrollController,
|
||||||
itemBuilder: (BuildContext context, int index) {
|
itemBuilder: (BuildContext context, int index) {
|
||||||
WidgetsBinding.instance!.addPostFrameCallback((timeStamp) {
|
if (_scrollController.position.maxScrollExtent -
|
||||||
_scrollController.animateTo(
|
_scrollController.offset <
|
||||||
_scrollController.position.maxScrollExtent,
|
10) {
|
||||||
duration: const Duration(milliseconds: 500),
|
WidgetsBinding.instance!
|
||||||
curve: Curves.easeOut);
|
.addPostFrameCallback((timeStamp) {
|
||||||
});
|
_scrollController.animateTo(
|
||||||
|
_scrollController.position.maxScrollExtent,
|
||||||
|
duration: const Duration(milliseconds: 500),
|
||||||
|
curve: Curves.easeOut);
|
||||||
|
});
|
||||||
|
}
|
||||||
return StreamElementCard(
|
return StreamElementCard(
|
||||||
streamElement: streamElements[index]);
|
streamElement: streamElements[index]);
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue