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

select_dialog 封面
套件詳情v2.0.2

select_dialog

用於從清單中選擇項目之套件,並可選擇過濾甚至線上搜尋項目。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
3020
喜歡數
97
Pub 分數
150

安裝套件

flutter pub add select_dialog

套件介紹

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

一個 Flutter 套件,提供可自訂的對話方塊,用於從清單中選擇項目,具備過濾與可選的線上搜尋功能。它透過即時搜尋與動態過濾,協助使用者快速瀏覽大量資料集,提升使用者體驗。適用於表單、設定或任何需要項目選擇的 UI。此套件支援 Android、iOS、Web、macOS、Windows 與 Linux 多個平台,確保跨裝置行為一致。

適用情境

  • 表單欄位選擇
  • 使用者偏好設定
  • 動態資料過濾
  • 線上項目搜尋
  • 多平台應用介面
  • 列表中的資料查找

主要特色

  • 即時過濾
  • 線上搜尋整合
  • 跨平台相容性
  • 可自訂的 UI
  • 簡單 API 結合
  • 對大型資料集的支援

適合對象

  • 開發跨平台應用的開發者
  • 需要可搜尋下拉選單的應用
  • 以UI為主的應用程式,具備資料選擇功能
  • 重視跨平台一致使用者體驗的團隊
  • 需要輕量級對話框解決方案的專案

使用建議

  • 需要手動實作線上搜尋邏輯
  • 僅限基本樣式自訂
  • 複雜的使用案例可能需要額外的狀態管理
  • 未針對無分頁的超大資料集進行優化
  • 依賴外部相依性以實現進階功能

原始 README

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

select_dialog Package

Package designed to select an item from a list, with the option to filter and even search the items online.

Versions

Non Null Safety Version: 1.2.3 or less

Null Safety Version: 2.0.0 or more

pubspec.yaml

select_dialog: <last version>

import

import 'package:select_dialog/select_dialog.dart';

Simple example

String ex1 = "No value selected";

SelectDialog.showModal<String>(
  context,
  label: "Simple Example",
  selectedValue: ex1,
  items: List.generate(50, (index) => "Item $index"),
  onChange: (String selected) {
    setState(() {
      ex1 = selected;
    });
  },
);

Multiple items select

List<String> ex5 = [];

SelectDialog.showModal<String>(
  context,
  label: "Multiple Items Example",
  multipleSelectedValues: ex5,
  items: List.generate(50, (index) => "Item $index"),
  onMultipleItemsChange: (List<String> selected) {
    setState(() {
      ex5 = selected;
    });
  },
); 
MORE EXAMPLES

Attention

To use a template as an item type, you need to implement toString, equals and hashcode, as shown below:

class UserModel {
  final String id;
  final DateTime createdAt;
  final String name;
  final String avatar;

  UserModel({this.id, this.createdAt, this.name, this.avatar});

  @override
  String toString() => name;

  @override
  operator ==(o) => o is UserModel && o.id == id;

  @override
  int get hashCode => id.hashCode^name.hashCode^createdAt.hashCode;

}

Getting Started

This project is a starting point for a Dart package, a library module containing code that can be shared easily across multiple Flutter or Dart projects.

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

所屬分類

原始碼儲存庫

使用此套件的專案