搜索插件、代码仓与 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.

所属分类

源码仓库

使用此插件的项目