FLUTTER ECOSYSTEM

renefloor/side_header_list_view

具有黏性標題的 ListView,類似於 Android 通訊錄頁面

side_header_list_view 專案封面
Stars
205
Forks
26
最近推送(UTC)
2021年3月12日
專案狀態
未封存
Rene Floor GitHub avatar
GITHUB User

Rene Floor ↗

Amersfoort, The Netherlands
語言DartObjective-CJava

此儲存庫發佈的套件

使用的依賴

依賴清單 3 項
  • flutter{"sdk":"flutter"}
  • meta^1.1.6
  • test開發依賴^1.3.0

原始 README

以下為英文專案原文快照,最新內容請造訪 GitHub。

展開 / 收合專案 README

side_header_list_view

pub package Donate

Listview with sticky headers like the Android contact page

alt text

Usage

  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;
    },
  );