パッケージ、リポジトリ、アプリカテゴリを検索

multiple_search_selection のカバー
パッケージ詳細v3.0.0

multiple_search_selection

ファズィー検索機能を備えた、非常にカスタマイズ可能な複数選択ウィジェット。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
1370
いいね数
73
Pub ポイント
150

パッケージをインストール

flutter pub add multiple_search_selection

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

大規模なデータセットから複数の項目を効率的に選択できる、高度にカスタマイズ可能なマルチセレクションウィジェットです。曖昧検索機能を備えており、インテリジェントなマッチングによるリアルタイムフィルタリングをサポートしており、フォームやタグ、フィルターなど、複数のオプションを選択する必要がある場面に最適です。クロスプラットフォームでのスムーズなパフォーマンスを実現するように設計されており、スタイルや動作について広範なカスタマイズが可能です。Flutterで構築されており、Android、iOS、Web、macOS、Windows、Linux向けアプリへのシームレスな統合が可能です。

用途

  • 複数の選択肢を持つフォーム入力
  • タグ選択インターフェース
  • 動的検索を備えたフィルタリングシステム
  • ユーザーの好みの選択
  • 検索機能付きの動的ドロップダウン
  • 管理パネルでのマルチセレクト

主な機能

  • 柔軟な一致のための曖昧検索
  • カスタマイズ可能なUIとスタイリング
  • 大規模データセットのサポート
  • クロスプラットフォーム互換性
  • リアルタイム検索フィルタリング
  • 明確なフィードバック付きの複数選択

適している対象

  • 複雑なフォームコンポーネントを構築する開発者
  • 効率的な複数項目選択を必要とするアプリ
  • ドロップダウンでインテリジェントな検索が必要なプロジェクト
  • クロスプラットフォームの整合性を重視するチーム
  • 軽量かつ強力な選択ウィジェットを希望するユーザー

注意事項

  • 非常に大きなデータセットに対して調整が必要になる場合があります
  • カスタマイズオプションは初期設定の複雑さを増す可能性があります
  • パフォーマンスはアイテムレンダリングの最適化に依存します
  • 制限された組み込み検証機能
  • 単一選択の使用ケースには適していません

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

Version Version

Show some love by dropping a ⭐ at GitHub
HTML tutorial

A highly customizable multiple selection widget with fuzzy search functionality
// Use this controller to adjust the behaviour of the widget
// 1. getAllItems
// 2. getPickedItems
// 3. searchItems
// 4. clearSearchField
// 5. clearAllPickedItems
// 6. selectAllItems
// 7. minCharsToShowItems
// 8. allowDuplicateSelection
// 9. isSelectable
MultipleSearchController controller = MultipleSearchController();
MultipleSearchSelection<Country>(
  // The TextField that is used to search items.
  //
  // You can use this to customize the search field.
  // The `onChanged` of the `searchField` is used internally to search items,
  // so you can use the `onSearchChanged` callback to get the search query.
  searchField: TextField(
    decoration: InputDecoration(
      hintText: 'Search countries',
      border: OutlineInputBorder(
        borderRadius: BorderRadius.circular(6),
        ),
      ),
    ),
  onSearchChanged: (text) {
    print('Text is $text');
  },
  items: countries, // List<Country>
  fieldToCheck: (c) {
    return c.name; // String
  },
  itemBuilder: (country,index,isPicked) {
    return Padding(
      padding: const EdgeInsets.all(6.0),
      child: Container(
        decoration: BoxDecoration(
          borderRadius: BorderRadius.circular(6),
          color: Colors.white,
        ),
        child: Padding(
          padding: const EdgeInsets.symmetric(
            vertical: 20.0,
            horizontal: 12,
          ),
          child: Text(country.name),
        ),
      ),
    );
  },
  pickedItemBuilder: (country) {
    return Container(
      decoration: BoxDecoration(
        color: Colors.white,
        border: Border.all(color: Colors.grey[400]!),
      ),
      child: Padding(
        padding: const EdgeInsets.all(8),
        child: Text(country.name),
      ),
    );
  },
  onTapShowedItem: () {},
  onPickedChange: (items) {},
  onItemAdded: (item) {},
  onItemRemoved: (item) {},
  sortShowedItems: true,
  sortPickedItems: true,
  fuzzySearch: FuzzySearch.jaro,
  itemsVisibility: ShowedItemsVisibility.alwaysOn,
  title: Text(
    'Countries',
    style: kStyleDefault.copyWith(
      fontSize: 22,
      fontWeight: FontWeight.bold,
    ),
  ),
  showSelectAllButton: true,
  maximumShowItemsHeight: 200,
)
MultipleSearchSelection<T>.creatable

MultipleSearchSelection<T>.creatable constructor can now create new item when search result does not return any results. It takes a new required parameter, createOptions e.g :

// [T] here is [Country]
createOptions: CreateOptions<Country>(
    // You need to create and return the item you want to add since [T] is not always [String].
    create: (text) {
        return Country(name: text, iso: text);
    },
    // A callback when the item is succesfully created.
    onCreated: (c) => print('Country ${c.name} created'),
    // Create item Widget that appears instead of no results.
    createBuilder: (text) => Align(
        alignment: Alignment.centerLeft,
            child: Padding(
                padding: const EdgeInsets.all(8.0),
                child: Text('Create "$text"'),
            ),
        ),
    // Whether you want to pick the newly created item or just add it to your list. Defaults to false.
    pickCreated: true,
),
Creatable
Showed items visibility

itemsVisibility behaviour for the default & creatable constructors

ShowedItemsVisibility.alwaysOn ShowedItemsVisibility.onType ShowedItemsVisibility.toggle
Always On On type Toggle

Issues / Features

Found a bug or want a new feature? Open an issue in the Github repository of the project.

カテゴリー

依存関係

依存関係一覧 1 件

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。