搜尋套件、儲存庫與 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.

所屬分類

原始碼儲存庫

使用此套件的專案