1
0
Fork 0

Fix end scroll

This commit is contained in:
Florian RICHER (MrDev023) 2022-04-26 21:38:26 +02:00
parent 8372769fbb
commit f256b1aee7

View file

@ -74,14 +74,20 @@ class _HomePageState extends State<HomePage> {
(element) => element!.uuid == snapshot.data!.uuid,
orElse: () => null) !=
null;
if (!alreadyAdded) streamElements.add(snapshot.data!);
if (!alreadyAdded) {
streamElements.add(snapshot.data!);
}
}
return ListView.builder(
itemCount: streamElements.length,
controller: _scrollController,
itemBuilder: (BuildContext context, int index) {
_scrollController
.jumpTo(_scrollController.position.maxScrollExtent);
WidgetsBinding.instance!.addPostFrameCallback((timeStamp) {
_scrollController.animateTo(
_scrollController.position.maxScrollExtent,
duration: const Duration(milliseconds: 500),
curve: Curves.easeOut);
});
return StreamElementCard(
streamElement: streamElements[index]);
},