搜尋套件、儲存庫與 APP 分類

套件詳情v2.0.2

infinite_widgets

無限版面小工具,讓您能輕鬆從資料庫或網路呼叫建立無限清單或無限網格。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
584
喜歡數
19
Pub 分數
140

安裝套件

flutter pub add infinite_widgets

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

InfiniteWidgets 是一個 Flutter 套件,可簡化無限捲動清單和網格的建立,非常適合從資料庫或網路來源逐步載入資料。它提供處理分頁邏輯的佈局元件,無縫減少重複程式碼。專為效能設計,可依需求有效載入項目,非常適合大型資料集。此套件支援所有主要平台,包括 Android、iOS、Web、macOS、Windows 和 Linux。

適用情境

  • 從API加載大型數據集
  • 建立無限滾動的動態資訊流
  • 使用延遲加載建構動態網格
  • 在應用程式中實現分頁內容
  • 顯示即時資料流

主要特色

  • 高效的情性載入
  • 對無限清單和網格的支援
  • 內建分頁處理
  • 跨平台相容性
  • 最少的樣板程式碼
  • 流暢的使用者體驗

適合對象

  • 包含大量資料集的應用程式
  • 社群媒體訊息
  • 電子商務商品清單
  • 即時資料顯示
  • 尋求簡單分頁的開發者

使用建議

  • 需要正確的狀態管理
  • 可能需要自定錯誤處理
  • 最適合連續資料流
  • 不適合小型靜態清單
  • 性能取決於資料來源的效率

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

infinite_widgets

Infinite layout widgets like lists, grids...

Infinite list

InfiniteListView has same attributes as a normal flutter ListView widget.

InfiniteListView.separated(
        itemBuilder: (context, index) {
          return Text('$index', style: TextStyle(color: Colors.red, fontWeight: FontWeight.bold));
        },
        itemCount: _data.length, // Current itemCount you have
        hasNext: _data.length < 200, // let the widget know if you have more data to show or not
        nextData: this.loadNextData, // callback called when end to the list is reach and hasNext is true
        separatorBuilder: (context, index) => Divider(height: 1),
      ),
    );

You can specify the last loading row by providing loadingWidget.

You can interact with the trigger to load additional data by default it's 300 but you can override it with scrollThreshold.

Infinite grid

InfiniteGridView has same attributes as a normal flutter GridView widget.

InfiniteGridView(
        gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 4),
        itemBuilder: (context, index) {
          return Text('$index', style: TextStyle(color: Colors.white));
        },
        itemCount: _data.length, // Current itemCount you have
        hasNext: _data.length < 200, // let the widget know if you have more data to show or not
        nextData: this.loadNextData, // callback called when end to the list is reach and hasNext is true
      ),
    );

You can specify the last loading row by providing loadingWidget.

You can interact with the trigger to load additional data by default it's 300 but you can override it with scrollThreshold.

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。