📜  Flutter listview builder - 任何代码示例

📅  最后修改于: 2022-03-11 15:00:43.201000             🧑  作者: Mango

代码示例3
return new ListView.builder( 
    scrollDirection: Axis.vertical, 
    itemCount: snapshot.data.documents.length, 
    itemBuilder: (context, index) { 
        if (index == 0) {
            return someWidget, // return the widget you want as "header" here
        } else {
           return _buildList( context, snapshot.data.documents[index-1]), 
        }
    }
);