Search packages, repositories and app categories

field_suggestion cover
Package detailsv0.2.6

field_suggestion

Create highly customizable, simple, and controllable autocomplete fields.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
643
Likes
45
Pub points
160

Install package

flutter pub add field_suggestion

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

FieldSuggestion is a Flutter package that enables developers to create highly customizable, simple, and controllable autocomplete fields. It provides a clean API for building input fields with real-time suggestions, supporting both text and custom widget rendering. The package works across all major platforms including Android, iOS, Web, macOS, Windows, and Linux, making it ideal for cross-platform applications requiring intelligent input handling. With built-in control over suggestion visibility, filtering logic, and styling, FieldSuggestion offers flexibility without complexity.

Use cases

  • Form inputs with dynamic suggestions
  • Search bars with predictive text
  • Custom dropdowns in forms
  • User-friendly data entry interfaces
  • Real-time filtering of large datasets

Key features

  • Highly customizable suggestion UI
  • Cross-platform compatibility
  • Simple and intuitive API
  • Support for custom widgets in suggestions
  • Built-in filtering and control logic
  • Lightweight and performant

Suitable for

  • Developers building form-heavy apps
  • Teams needing consistent autocomplete behavior
  • Apps requiring platform-agnostic input components
  • Projects with complex user input needs

Considerations

  • Requires manual implementation of data source logic
  • Limited built-in themes or styling presets
  • Best suited for static or predictable suggestion sources

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.


Field Suggesion's Logo

Field Suggesion's Title Logo


Installing

Usage

In this example, we're using the FieldSuggestion.network widget to display suggestions for a username input field. We've provided an inputDecoration with a hint text, a future function that fetches the suggestions based on the user input, a textController that controls the text in the input field, a boxController that controls the visibility of the suggestion box, and a builder function that defines how the suggestions are displayed in the suggestion box.

Note that FieldSuggestion uses generics to allow for suggestions of different types. In the example above, we're using String as the type parameter for FieldSuggestion.network However, any other type can be used, depending on the type of suggestions being displayed.

FieldSuggestion<String>.network(
  inputDecoration: InputDecoration(
    hintText: 'Username', // optional
  ),
  future: (input) => future.call(input),
  textController: controller,
  boxController: boxController, // optional
  builder: (context, snapshot) {
    if (snapshot.connectionState != ConnectionState.done) {
      return Center(child: CircularProgressIndicator());
    }

    final result = snapshot.data ?? [];
    return ListView.builder(
      itemCount: result.length,
      itemBuilder: (context, index) {
        return GestureDetector(
          onTap: () {
            setState(() => controller.text = result[index]);
            boxControllerNetwork.close?.call();
          },
          child: Card(child: ListTile(title: Text(result[index]))),
        );
      },
    );
  },
)

Contributing

  • For information regarding contributions, please refer to CONTRIBUTING.md file.

Categories

Dependencies

Dependency list 1 items

  • highlightable^1.0.5

Source repository

Projects using this package

No data available yet.