I am fetching ListView.builder() items from Cloud Firestore inside a StreamBuilder. I want the new item to be added at the top of the ListView. How can I do that? I tried reverse : true , though it reverse the ListView, but when there is only 2/3 items, the ListView looks ugly, as the ListView starts from bottom and the upper portion of the screen remains empty.
Added shrinkWrap: true and put the ListView inside an Align widget with alignment: Alignment.topCenter and got the result I wanted!
Align(
alignment: Alignment.topCenter,
child: ListView.builder(
reverse: true,
shrinkWrap: true,
...
...
)
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With