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

item_selector 封面
套件詳情v0.2.0

item_selector

一個通用的項目選擇器,可與 ListView、GridView、Row、Column 或基本上任何可以擁有索引子項的父組件一起使用。

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

安裝套件

flutter pub add item_selector

套件介紹

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

一個靈活且通用的 Flutter 項目選擇器,可讓您在支援索引子項的任何父組件(例如 ListView、GridView、Row 或 Column)中選擇項目。它為管理不同佈局類型的已選項目提供了統一介面,無需為每種類型編寫自訂邏輯。非常適合建立具有可選元素的互動式清單和網格。

適用情境

  • 在動態列表中選擇項目
  • 建構互動式網格版面
  • 在可滾動容器中管理多個選擇
  • 建立可自定義的選擇介面
  • 與表單或篩選器整合

主要特色

  • 適用於任何索引父級小部件
  • 支援單選和多選
  • 通用類型安全
  • 用於選擇狀態管理的簡單 API
  • 輕量且不顯眼

適合對象

  • 開發互動式清單的開發者
  • 需要項目選擇的UI組件
  • 具有動態或嵌套佈局的應用程式
  • 可自訂的表單控制項
  • 需要一致選擇行為的跨平台應用

使用建議

  • 若未使用內建回呼,則需手動處理選擇狀態
  • 可能需要額外的樣式以提供視覺反饋
  • 未針對無分頁的大資料集進行優化
  • 限於索引子結構
  • 選擇變更沒有內建動畫

原始 README

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

Item Selector for Flutter

pub license: MIT build codecov

A generic Flutter item selector that works with ListView, GridView, Row, Column, or basically any parent widget that can have indexed child widgets. It supports single-selection by tap, and multi-selection by long-press and drag with auto-scrolling.

Preview

ListView GridView
ListView GridView
Column Custom
Column Custom

Usage

To use this package, add item_selector as a dependency in your pubspec.yaml file.

ItemSelectionController(
  child: ListView(
    children: List.generate(10, (int index) {
      return ItemSelectionBuilder(
        index: index,
        builder: (BuildContext context, int index, bool selected) {
          return Text('$index: $selected');
        },
      );
    }),
  ),
)

Thanks

Item Selector is based on Multi Select GridView in Flutter - by Simon Lightfoot.

所屬分類

依賴

依賴清單 1 項

  • interval_tree^0.3.0

原始碼儲存庫

使用此套件的專案

暫無相關資料。