FLUTTER ECOSYSTEM

renefloor/side_header_list_view

Androidの連絡先ページのようにスタックヘッダー付きのListView

side_header_list_view のプロジェクト画像
Stars
205
Forks
26
最終プッシュ(UTC)
2021/03/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;
    },
  );