Skip to content
pubscout

searchfield

2.0.0, released 9 months ago by maheshjamdade.com

An autocomplete search widget with customizable suggestions, validation, and keyboard navigation.

WASM-ready
$ flutter pub add searchfield
Source repository

What it does

Provides a customizable search field that displays an overlay list of suggestions based on user input. It supports dynamic item heights, custom widgets for list items, network-based lazy loading, and validation.

AI-written summary of version 2.0.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need an autocomplete text input with search suggestions.
  • You require custom widgets and decorations inside suggestion lists.
  • You need keyboard navigation support for desktop platforms.

Skip it when

  • You require a complex multi-field form builder with built-in state management solutions.

Strengths

  • Highly customizable input decoration, suggestions decoration, and item widgets.
  • Supports keyboard navigation for desktop apps.
  • Allows dynamic positioning of suggestions and lazy loading from the network.

Weaknesses

  • Requires manual handling of asynchronous filtering and state management for network suggestions.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0

None

SearchField(
  hint: 'Search for a city or zip code',
  maxSuggestionBoxHeight: 300,
  onSuggestionTap: (SearchFieldListItem<City> item) {
    setState(() {
      selectedValue = item;
    });
  },
  selectedValue: selectedValue,
  suggestions: cities,
  suggestionState: Suggestion.expand,
)

Alternatives

Packages that do the same job and could replace searchfield.