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

animated_item_picker 封面
套件詳情v2.0.0

animated_item_picker

通用項目選擇器,封裝了單個或多個項目選擇的邏輯。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
118
喜歡數
33
Pub 分數
150

安裝套件

flutter pub add animated_item_picker

套件介紹

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

Animated Item Picker 是一個 Flutter 套件,提供可自訂的動畫介面,用於從清單中選擇單一或多個項目。它封裝了選擇邏輯,具備順暢的過渡效果與視覺反饋,非常適合表單、篩選或偏好設定。此套件支援所有主要平台,包括 Android、iOS、Web、macOS、Windows 與 Linux,確保跨裝置行為一致。透過直覺的 API 與內建動畫,簡化互動式項目選擇的實作,無需自訂狀態管理。

適用情境

  • 具有可選選項的表單輸入
  • 過濾介面
  • 使用者偏好選擇器
  • 多選下拉選單
  • 互動式列表導航

主要特色

  • 流暢的動畫過渡
  • 支援單選與多選
  • 跨平台相容性
  • 可自訂外觀
  • 內建的選擇狀態管理
  • 輕量且易於整合

適合對象

  • 開發互動式表單的開發者
  • 需要精緻選擇介面的設計師
  • 需要多選功能的應用程式
  • 針對多個平台的專案
  • 希望擁有可重用選擇組件的團隊

使用建議

  • 可能需要額外的樣式才能適應複雜主題
  • 僅限基本選擇模式
  • 未針對非常大的資料集進行優化
  • 動畫效能取決於裝置功能
  • 需要理解 Flutter 的狀態管理

原始 README

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

Animated Item Picker

Generic item picker that encapsulates single or multiple item selection logic.

Suitable for fixed size item lists, e.g level, week day or gender selector etc.

Supports tapUp/tapDown item opacity animation.

Preview

Usage

  @override
  Widget build(BuildContext context) {
    return AnimatedItemPicker(
          axis: Axis.horizontal,
          multipleSelection: false,
          itemCount: yourModelList.length,
          pressedOpacity: 0.85,
          initialSelection: {defaultItemIndex},
          onItemPicked: (index, selected) {
         
          },
          itemBuilder: (index, animValue, selected) => _YourItemWidget(
            name: yourModelList[index].name,
            borderColor: _colorTween1.transform(animValue),
            textColor: _colorTween2.transform(animValue),
            iconColor: _colorTween3.transform(animValue)
          ),
      );
  }

Article

Often a user has to make a choice in an application, eg. gender, difficulty level, or switch a tab, etc. You can agree that well-designed animated item selection will make your UI look more intuitively with enhanced User Experience.

We at KiRN tech use this element so often that we decided to create a separate package for it.

Here we'll walk through the base stages of this package creation:

  • Define AnimatedItemPicker API.
  • Implement select/unSelect item animation
  • Animate item selection opacity

More: https://kirn.tech/article-flutteranimation-animated-item-picker

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。