v0.0.4side_header_list_view
具有側邊黏性標題的 ListView。靈感來自 Android 通訊錄應用程式和日曆應用程式。
42喜歡 25近 30 天下載30Pub 分數
平台暫無資料
具有黏性標題的 ListView,類似於 Android 通訊錄頁面
以下為英文專案原文快照,最新內容請造訪 GitHub。
Listview with sticky headers like the Android contact page
alt text
new SideHeaderListView(
// Set how many items the list has
itemCount: items.length,
// Set the height of the item widgets. For now this has to be a fixed height
itemExtend: 150.0,
// Set the header builder, this needs to return the widget for the side header
headerBuilder: (BuildContext context, int index){
return new HeaderWidget(items[index].startDate);
},
// Set the item builder, this is everything in the row without the header
itemBuilder: (BuildContext context, int index){
return new ListItem(items[index]);
},
// HasSameHeader will be used to know whether the header has to be shown for a position
hasSameHeader: (int a, int b){
return items[a].day == items[b].day;
},
);