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

패키지 상세v3.0.0

flutter_search_bar

Flutter의 AppBar 내에 (대부분) 자동 검색창

30일 다운로드
1.1천
좋아요
121
Pub 점수
60

패키지 설치

flutter pub add flutter_search_bar

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

최소한의 설정으로 AppBar에 통합된 검색창을 제공하는 플러터 패키지입니다. 자동으로 검색 입력, 필터링 및 UI 업데이트를 처리하여 뼈대 코드 없이 앱에 검색 기능을 쉽게 추가할 수 있습니다. 실시간 필터링을 지원하며 다양한 디자인 요구사항에 맞게 커스터마이징할 수 있습니다. AppBar 내에서 원활하게 작동하도록 설계되어 깔끔하고 직관적인 사용자 경험을 제공합니다. 이 패키지는 GitHub에서 유지 관리되며, 플러터 앱에 검색 기능을 구현하고자 하는 개발자에게 적합합니다.

사용 사례

  • 목록 뷰에서 검색 구현
  • 실시간으로 데이터 필터링
  • 검색을 통한 앱 내비게이션 향상
  • 앱 바에 검색 통합
  • 동적 콘텐츠 필터 구축

주요 기능

  • 자동 관리되는 검색 상태
  • 실시간 필터링
  • AppBar 통합
  • 최소 구성
  • 사용자 정의 가능한 UI
  • 비동기 필터링을 지원합니다

적합한 대상

  • 검색 중심 앱을 개발하는 개발자
  • 빠른 검색 구현이 필요한 앱
  • 클린한 검색 바가 필요한 사용자 인터페이스 중심 프로젝트
  • Flutter 초보자가 검색 기능 탐색 중
  • 동적 데이터 소스를 가진 프로젝트

고려 사항

  • 제한된 플랫폼별 사용자 정의
  • 내장된 제안이나 자동 완성 없음
  • 비동기 결과를 수동으로 처리해야 합니다
  • 매우 큰 데이터 세트에 최적화되지 않음
  • 복잡한 논리를 위해 외부 상태 관리에 의존합니다

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

Archive Notice

This repository is archived. 3.0.0 is the last version that I will publish.

The SearchBar still works and it's pretty simple if you'd like to fork it. I just don't have the time to maintain it.

flutter_search_bar

A simple and mostly automatic material search bar for flutter (dart).

Note: use flutter_search_bar and not search_bar -- I own both packages but I'm just a tad bit locked out of search_bar, so it won't be updated.

Screenshots

Normal state (search is not active yet, only title and actions are set, with the only action being a search button)

Normal State

inBar set to false (background white, back button inherited):

inBar false

inBar set to true (background inherited):

inBar true

Usage

A simple usage example:

class _MyHomePageState extends State<MyHomePage> {
  SearchBar searchBar;
  
  AppBar buildAppBar(BuildContext context) {
    return new AppBar(
      title: new Text('My Home Page'),
      actions: [searchBar.getSearchAction(context)]
    );
  }  
  
  _MyHomePageState() {
    searchBar = new SearchBar(
      inBar: false,
      setState: setState,
      onSubmitted: print,
      buildDefaultAppBar: buildAppBar
    );
  }
  
  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: searchBar.build(context)
    );
  }
}

This will create an AppBar with a search button as its only action, and on press the AppBar will turn white and have a TextField inside, allowing user input. Once the user has input something and pressed the "enter" button on their keyboard, it will close and the value will be printed to the debugger.

Using SearchBar

Essentially, this class returns two different app bars based on whether search is active.

The setState callback you pass the search bar can technically be any VoidCallback.

Features and bugs

Please file feature requests and bugs at the issue tracker.

We've recently added support for null-safety in 3.0.0 -- if you find any issues, please report them there!

카테고리

소스 저장소

이 패키지를 사용하는 프로젝트