搜索插件、代码仓与 APP 分类

插件详情v2.3.0

search_page

在您的应用中快速轻松地构建自定义搜索体验

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
910
喜欢数
197
Pub 分数
150

安装插件

flutter pub add search_page

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

一个 Flutter 包,可帮助开发者快速在其应用程序中创建可自定义的搜索体验。它提供了一种简化的方法来实现搜索功能,内置了实时过滤、防抖处理以及与数据源的轻松集成支持。设计简洁高效,减少了样板代码,同时在 UI 自定义方面提供了灵活性。该包可在所有主要平台上兼容,非常适合需要一致搜索界面的跨平台应用。

适合场景

  • 在列表中实现实时搜索
  • 以最少的努力构建自定义搜索 UI
  • 将搜索与动态数据源集成
  • 为网页和移动设备创建响应式搜索栏
  • 为电子商务应用添加搜索功能
  • 通过即时结果提升用户体验

主要特点

  • 带防抖的实时搜索
  • 可自定义的搜索 UI 组件
  • 跨平台兼容性
  • 轻松集成任何数据源
  • 支持异步搜索操作
  • 轻量且高效

适合对象

  • 开发搜索密集型应用的开发者
  • 注重快速原型设计的团队
  • 跨平台需要一致搜索的应用程序
  • 专注于用户体验改进的前端开发人员
  • Flutter 初学者探索搜索功能

使用建议

  • 需要手动设置以实现复杂的过滤逻辑
  • 内置样式选项有限,仅限基本自定义
  • 可能需要额外的状态管理来处理大型数据集
  • 未针对极高频率的搜索查询进行优化
  • 依赖外部数据源实现

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

Search Page

Package style: very good analysis Build Patreon License

Fast and easy way to build a custom search experience in you app.

This package aims to provide a simple way to build a search view, using available resources from the Flutter framework. It uses SearchDelegate as its fondation, in oder to build a 'material' experience.

One of the special features of this package is the filter parameter. It's a very simple way to filter out items inside a list, using different string representations.

Also, you can customize suggestion and on-error widgets, provide custom search filters, change AppBar's theme...

Example

Here is a example on how to use this package. You'd need to call the SearchPage class using the showSearch function built in.

If you want to take a deeper look at the example, take a look at the example folder provided with the project.

FloatingActionButton(
  child: Icon(Icons.search),
  tooltip: 'Search people',
  onPressed: () => showSearch(
    context: context,
    delegate: SearchPage<Person>(
      items: people,
      searchLabel: 'Search people',
      suggestion: Center(
        child: Text('Filter people by name, surname or age'),
      ),
      failure: Center(
        child: Text('No person found :('),
      ),
      filter: (person) => [
        person.name,
        person.surname,
        person.age.toString(),
      ],
      builder: (person) => ListTile(
        title: Text(person.name),
        subtitle: Text(person.surname),
        trailing: Text('${person.age} yo'),
      ),
    ),
  ),
),

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.

Built with

Authors

License

This project is licensed under the GNU GPL v3 License - see the LICENSE file for details.

所属分类

源码仓库

使用此插件的项目