패키지, 저장소 및 앱 카테고리 검색

GitHub 저장소koukibadr/Searchable-Listview

검색 가능한 리스트뷰

koukibadr/Searchable-Listview open-source repository details.

검색 가능한 리스트뷰 프로젝트 이미지
스타
35
포크
24
최근 푸시(UTC)
2026. 8. 31.
프로젝트 상태
활성

원본 README

아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.

Searchable ListView

Searchable ListView

An easy-to-use Flutter widget for adding a searchable, sortable, and paginated list UI. Supports synchronous lists, asynchronous data sources, expansion groups, slivers, pull-to-refresh, and many customization options.

Package: searchable_listview

Features

  • Filter lists on edit or submit
  • Support for async data sources and async filtering
  • Expansion-group lists with searchable group contents
  • Optional sort widget and custom sort predicate
  • Pagination and onPaginate callback
  • Pull-to-refresh support
  • Sliver-based scrolling effect
  • Customizable loading / error / empty widgets
  • Customizable search field (decoration, input type, icons, width/height)
  • Auto-complete hints and secondary widgets next to the search field

Installation

Add the package to your pubspec.yaml:

dependencies:
  searchable_listview: ^2.19.5

Then run:

flutter pub get

Quick Start

Basic synchronous list example:

SearchableList<Actor>(
  initialList: actors,
  itemBuilder: (actor) => ActorItem(actor: actor),
  filter: (query) => actors
      .where((a) => a.name.toLowerCase().contains(query.toLowerCase()))
      .toList(),
  emptyWidget: const Center(child: Text('No results')),
  inputDecoration: InputDecoration(labelText: 'Search actor'),
)
Async list example

Use the .async constructor when data comes from a Future and you need to filter the returned list:

SearchableList<Actor>.async(
  asyncListCallback: () async => await fetchActors(),
  asyncListFilter: (query, list) =>
      list.where((a) => a.name.contains(query)).toList(),
  itemBuilder: (actor) => ActorItem(actor: actor),
  loadingWidget: const Center(child: CircularProgressIndicator()),
  errorWidget: const Center(child: Icon(Icons.error)),
)
Expansion groups

For grouped/expansion lists use the .expansion constructor:

SearchableList<Actor>.expansion(
  expansionListData: mapOfActors,
  expansionTitleBuilder: (key) => Text(key.toString()),
  filterExpansionData: (query) => {
    for (final entry in mapOfActors.entries)
      entry.key: (mapOfActors[entry.key] ?? [])
          .where((a) => a.name.contains(query))
          .toList()
  },
  expansionListBuilder: (index, actor) => ActorItem(actor: actor),
)
Sliver list

Use .sliver to embed a searchable list inside sliver scroll views:

SearchableList<Actor>.sliver(
  initialList: actors,
  itemBuilder: (actor) => ActorItem(actor: actor),
  filter: (q) => actors.where((a) => a.name.contains(q)).toList(),
)

Common Parameters

  • initialList — initial synchronous list of items
  • filter — synchronous filter callback (String -> List)
  • asyncListCallback — Future that returns a List
  • asyncListFilter — filter that applies to results from asyncListCallback
  • itemBuilder — builder for list item widgets
  • emptyWidget, loadingWidget, errorWidget — custom widgets for states
  • onPaginate — callback when list reaches the end (for pagination)
  • inputDecoration, textStyle, textInputType — search field customization
  • sortWidget, sortPredicate — optional sorting UI and comparator
  • closeKeyboardWhenScrolling — whether scrolling hides the keyboard

For a complete list of available parameters and detailed API, see the library documentation or the source code in lib/searchable_listview.dart.

Example App

See the example/ folder for a runnable demo with multiple configurations and screenshots.

Example

Contributing

Contributions, issues and feature requests are welcome. Feel free to check the example/ folder for usage examples and open a pull request.

  • Report bugs by opening an issue
  • Suggest features by opening an issue
  • Submit pull requests for fixes and improvements

Repository: https://github.com/koukibadr/Searchable-Listview

License

This project is licensed under the terms in the LICENSE file.

Contributors

Kouki Badr GitHub avatar
GitHub 작성자

Kouki Badr ↗

> Senior Mobile Dev | Flutter OSS contributor | Cyborg coder by day, open-source ghost by night

NventiveTunisia
언어DartHTMLShellSwiftKotlinObjective-C

이 저장소가 배포한 패키지

사용 중인 의존성

의존성 목록 5 개

프로젝트에 맞는 저장소를 선택하려면?

사용 목적에 따라 검색하고 개발 활동을 비교한 뒤 원본 저장소에서 요구 사항을 확인하세요.

  1. 이름, 작성자 또는 설명으로 검색하고 기술 주제로 범위를 좁힙니다.
  2. 스타, 포크, 최근 푸시를 함께 비교하세요. 스타는 관심의 지표이며 품질을 보장하지 않습니다.
  3. 사용하기 전에 GitHub에서 README, 라이선스, Issues를 확인하세요.

출처 및 관리

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗