我在這里有一個索引,但我想在影像中從頭到尾顯示它:我想先顯示“你好”,然后再顯示其余部分
代碼:
StreamBuilder(
stream: FirebaseFirestore.instance
.collection("groups")
.doc(groupId)
.snapshots(),
builder: (context, AsyncSnapshot<DocumentSnapshot> snapshot) {
var chats = snapshot.data?["chats"];
return ...)};
ListView.builder(
physics: const BouncingScrollPhysics(),
itemCount: chats.length,
shrinkWrap: true,
itemBuilder: (context, index) {
return Text(chats[index]),
}),
基本上我想先顯示最近添加的字串。
uj5u.com熱心網友回復:
你必須reverse: ture在你的 listView 中,像這樣:
ListView.builder(
reverse:true,
physics: const BouncingScrollPhysics(),
itemCount: chats.length,
shrinkWrap: true,
itemBuilder: (context, index) {
return Text(chats[index]),
}),
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/510284.html
標籤:细绳扑镖颤振布局颤振依赖
