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

套件詳情v1.0.0

flutter_section_list_view

支援類似 iOS UITableView 分區的擴展 Flutter ListView

近 30 天下載
30
喜歡數
6
Pub 分數
40

安裝套件

flutter pub add flutter_section_list_view

套件介紹

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

一個擴展標準 ListView 的 Flutter 套件,支援類似於 iOS UITableView 的分段式清單。它讓開發者能將清單項目組織成帶有標題與頁腳的區段,提升複雜資料集的可讀性與結構。此套件設計為與現有的 Flutter 應用程式無縫整合,為來自 iOS 開發的開發者提供熟悉的介面。支援動態更新、自訂區段樣式及流暢的捲動效能。

適用情境

  • 建立群組聯絡人清單
  • 實現分段設定選單
  • 顯示分類產品目錄
  • 在 Flutter 中建構 iOS 風格的表格檢視
  • 按日期整理聊天訊息
  • 呈現層次資料結構

主要特色

  • 章節標題和頁尾
  • iOS UITableView 類似行為
  • 可自訂的區塊樣式
  • 動態資料更新
  • 平滑捲動效能
  • 對嵌套列表的支援

適合對象

  • 從 iOS 迁移到 Flutter 的開發者
  • 需要結構化數據的應用程式顯示
  • 需要分組的列表密集型UI
  • 優先考慮原生 iOS 使用者體驗模式的團隊
  • 需要乾淨、有條理的列表佈局的專案

使用建議

  • 有限的平台特定優化,超出 iOS 風格
  • 可能需要額外的樣式調整以適應非iOS設計
  • 在沒有分頁的情況下,不適合處理非常大的資料集
  • 無內建的拖曳排序支援
  • 依賴外部 GitHub 倉庫以取得更新

原始 README

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

flutter_section_list_view

A flutter list view which supports sections like iOS UITableView with no overhead

Usage

To use this plugin, add flutter_section_list_view as a dependency in your pubspec.yaml file.

Getting Started

Import this class
import 'flutter_section_list_view/flutter_section_list_view.dart';
Add flutter_section_list_view Widget

After importing this plugin to your project, you can simply use it as a normal widget


FlutterSectionListView(
        numberOfSection: 4,
        numberOfRowsInSection: (section) {
          return section * 3 + 1;
        },
        sectionWidget: (section) {
          return Container(child: Padding(
            padding: const EdgeInsets.all(8),
            child: Text('Section $section'),
          ), color: Colors.grey,);
        },
        rowWidget: (section, row) {
          return Container(
            child: Padding(
              padding: EdgeInsets.all(8),
              child: Text('Row $section - $row'),
            ),
          );
        },
      )

To use Pull-To-Refresh feature, simply provide value to attribute 'refresh', a callback function

listView.refresh = () async {
      await new Future.delayed(new Duration(seconds: 3));
      print('List Refreshed');
    };

For Pagination feature, provide value to attribute 'loadMoreData', a callback function

listView.loadMoreData = () async {
      await new Future.delayed(new Duration(seconds: 2));
      print('More Data loaded and List refreshed');
      /// set 'isMoreAvailable' attribute to 'false' when there are no more pages to return 
      listView.isMoreAvailable = false;
    };

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。