搜尋分類、套件與程式碼儲存庫

expandable_sliver_list 封面
套件詳情v4.1.1

expandable_sliver_list

一個可展開或收起的滑動清單,用於顯示或隱藏清單內容。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
797
喜歡數
29
Pub 分數
160

安裝套件

flutter pub add expandable_sliver_list

套件介紹

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

一個 Flutter 套件,提供可展開或收合以顯示或隱藏內容的滑動清單。非常適合需要使用者控制內容可見性的動態、節省空間的版面。專為在 CustomScrollView 內使用而設計,與滑動架構無縫整合。此套件支援所有主要平台,並在過渡過程中設計為流暢運作。

適用情境

  • 動態內容區塊
  • 可摺疊的常見問題部分
  • 互動式導航選單
  • 減少螢幕雜亂
  • 嵌套可滾動介面
  • 滾動視圖中的手風琴

主要特色

  • 可展開/可收合行為
  • 基於 Sliver 的效能
  • 平滑動畫
  • 可自定義的觸發器
  • 可在 CustomScrollView 內使用
  • 跨平台相容性

適合對象

  • 開發具有可摺疊內容的可捲動 UI 的開發者
  • 需要響應式佈局管理的應用程式
  • 大量使用 CustomScrollView 的項目
  • 注重空間效率的設計師

使用建議

  • 需要在 CustomScrollView 內部進行整合
  • 在大型清單中可能會影響效能
  • 限制為垂直滾動
  • 需要仔細的狀態管理
  • 不適用於非 Sliver 環境

原始 README

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

expandable_sliver_list

pub package flutter_tests codecov style: flutter lints License: MIT

A Flutter widget which creates a Sliver List that you can then either expand or collapse, in order to show or hide the contents of the list.

Getting Started

Installing

In your Flutter project, add the package to your dependencies

flutter pub add expandable_sliver_list

or

dependencies:
  ...
  expandable_sliver_list: ^4.1.0
  ...
Usage Example

A complete example on how to use this widget can be found in the example directory. But the basics are:

Import the package

import 'package:expandable_sliver_list/expandable_sliver_list.dart';

Create a controller and a list of items to display

ExpandableSliverListController controller = ExpandableSliverListController();

List<int> items = [1, 2, 3, 4, 5];

Create the widget

ExpandableSliverList<int>(
  initialItems: items,
  controller: controller,
  builder: (context, item, index) {
    return ListTile(
      title: Text(item.toString()),
    );
  },
)

Now you can use the controller to expand or collapse the list

controller.collapse();
controller.expand();

Or to add items to the list

controller.insertItem(54, 2);
controller.removeItem(4);

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。