Fix end scroll
This commit is contained in:
parent
8372769fbb
commit
f256b1aee7
1 changed files with 9 additions and 3 deletions
|
@ -74,14 +74,20 @@ class _HomePageState extends State<HomePage> {
|
||||||
(element) => element!.uuid == snapshot.data!.uuid,
|
(element) => element!.uuid == snapshot.data!.uuid,
|
||||||
orElse: () => null) !=
|
orElse: () => null) !=
|
||||||
null;
|
null;
|
||||||
if (!alreadyAdded) streamElements.add(snapshot.data!);
|
if (!alreadyAdded) {
|
||||||
|
streamElements.add(snapshot.data!);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return ListView.builder(
|
return ListView.builder(
|
||||||
itemCount: streamElements.length,
|
itemCount: streamElements.length,
|
||||||
controller: _scrollController,
|
controller: _scrollController,
|
||||||
itemBuilder: (BuildContext context, int index) {
|
itemBuilder: (BuildContext context, int index) {
|
||||||
_scrollController
|
WidgetsBinding.instance!.addPostFrameCallback((timeStamp) {
|
||||||
.jumpTo(_scrollController.position.maxScrollExtent);
|
_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