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

パッケージ詳細v1.0.2

search_widget

データリストからオプションを選択するための検索ウィジェットを提供するFlutterパッケージです。

30日間ダウンロード
61
いいね数
144
Pub ポイント
40

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

flutter pub add search_widget

パッケージ概要

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

データリストからオプションを選択するためのカスタマイズ可能な検索ウィジェットを提供するFlutterパッケージです。直感的なインターフェースにより、動的にアイテムをフィルタリングして選択できるようにし、検索機能の実装を簡素化します。大規模なデータセットへの迅速なアクセスが必要なアプリに最適で、リアルタイムのフィルタリングをサポートし、既存のUIにスムーズに統合できます。軽量であり、開発者の体験を重視して設計されています。

用途

  • フォームで大規模なデータセットをフィルタリングする
  • ユーザー一覧を検索しています
  • クイックセレクトドロップダウンの実装
  • 検索可能なメニューによるナビゲーションの強化
  • 動的オートコンプリート機能の構築

主な機能

  • リアルタイム検索フィルタリング
  • カスタマイズ可能な UI コンポーネント
  • 既存のウィジェットとの簡単な統合
  • 非同期データソースをサポートしています
  • 軽量でパフォーマンスに優れる

適している対象

  • データが多く含まれるアプリを開発する開発者
  • 検索可能なドロップダウンが必要なアプリ
  • 動的コンテンツ選択を備えた UI
  • 迅速な機能開発を重視するチーム
  • 最小限のボイラープレートを必要とするプロジェクト

注意事項

  • 制限されたプラットフォーム固有のカスタマイズ
  • 大規模なデータセットには組み込みのページネーションがありません
  • ロード状態を手動で処理する必要があります
  • バッチ処理なしで非常に大きなデータセットに最適化されていません
  • 外部データソース管理に依存しています

元の README

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

Search Widget Cirrus CI - Base Branch Build Status GitHub stars Twitter Follow GitHub last commit Website shields.io Open Source Love style: effective dart

This Flutter package provides a Search Widget for selecting an option from a data list. Provides filtering of items based on the search text.

PieChart

💻 Installation

In the dependencies: section of your pubspec.yaml, add the following line:

Version

dependencies:
  search_widget: <latest version>

❔ Usage

Import this class
import 'package:search_widget/search_widget.dart';
Add Search Widget
  • Accepts data list as input
  • Option for getting selected item. Returns selected item or null if item is deleted
onItemSelected: (item) {
    //Do whatever you would like
    setState(() {
       _selectedItem = item;
    });
 },
  • Option for pop list item builder. This basically returns a widget to show as list item in popup
popupListItemBuilder: (LeaderBoard item) {
   return PopupListItem(item);
 }
  • Option for filtering data list based on search query
queryBuilder: (String query, List<LeaderBoard> list) {
   return list.where((LeaderBoard item) => item.username.toLowerCase().contains(query.toLowerCase())).toList();
 }
  • Option provided for selected list item builder which enables when a user selects an item from pop up list
selectedItemBuilder: (LeaderBoard selectedItem, deleteSelectedItem) {
   return SelectedItem(selectedItem,deleteSelectedItem);
 }
  • Option for providing custom TextField. Accepts TextEditingController and FocusNode as parameter
textFieldBuilder: (TextEditingController controller, FocusNode focusNode) {
    return TextField(
        controller: controller,
        focusNode: focusNode,
        //... Other customizations here
       );
  },
Full Implementation
SearchWidget<LeaderBoard>(
   dataList: list,
   hideSearchBoxWhenItemSelected: false,
   listContainerHeight: MediaQuery.of(context).size.height / 4,
   queryBuilder: (String query, List<LeaderBoard> list) {
     return list.where((LeaderBoard item) => item.username.toLowerCase().contains(query.toLowerCase())).toList();
   },
   popupListItemBuilder: (LeaderBoard item) {
     return PopupListItemWidget(item);
   },
   selectedItemBuilder: (LeaderBoard selectedItem, VoidCallback deleteSelectedItem) {
     return SelectedItemWidget(selectedItem, deleteSelectedItem);
   },
   // widget customization
   noItemsFoundWidget: NoItemsFound(),
   textFieldBuilder: (TextEditingController controller, FocusNode focusNode) {
     return MyTextField(controller, focusNode);
   },
 )
Key Highlights
  • Adaptive Popup Position to prevent popup getting hidden behind keyboard

PieChart PieChart

  • Popup to scroll with scroll gesture if this widget is used inside ScrollView
PieChart

TODO

  • [X] Give support for onItemSelected method to return selected item(s) directly
  • [ ] Add support for selecting multiple items
  • [ ] Add visibility bool to show selected item widget

⭐ My Flutter Packages

  • pie_chart GitHub stars Flutter Pie Chart with cool animation.
  • avatar_glow GitHub stars Flutter Avatar Glow Widget with glowing animation.
  • json_table GitHub stars Create Flutter Json Table from json map directly.
  • animating_location_pin GitHub stars Flutter Animating Location Pin Widget providing Animating Location Pin Widget which can be used while fetching device location.

⭐ My Flutter Apps

👍 Contribution

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -m 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

カテゴリー

依存関係

依存関係一覧 1 件

ソースリポジトリ

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

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