searchable_textfeild 0.0.1 copy "searchable_textfeild: ^0.0.1" to clipboard
searchable_textfeild: ^0.0.1 copied to clipboard

A simple textfeild which can be used to search the data in the list or can be used as simple dropdown widget

Searchable TextField #

A customizable Flutter widget that combines the functionality of a TextField with dropdown search capabilities.

Features #

  • Standard TextField functionality
  • Dropdown with search functionality
  • API-based search support
  • Pagination for large datasets
  • Customizable appearance
  • Form validation support

Installation #

Add this to your package's pubspec.yaml file:

dependencies:
  searchable_textfield: ^latest_version

Usage #

Basic example:

SearchableTextField(
  controller: TextEditingController(),
  enabled: true,
  isDropdown: true,
  isObscured: false,
  items: [
    DropdownMenuItems(lable: "Item 1", value: "1"),
    DropdownMenuItems(lable: "Item 2", value: "2"),
  ],
  onChanged: (value) {
    print("Selected value: $value");
  },
)

API-based search example:

SearchableTextField(
  controller: TextEditingController(),
  enabled: true,
  isDropdown: true,
  isObscured: false,
  getItems: ({page, filter, limit}) async {
    // Implement your API call here
    return yourApiCall(page: page, searchText: filter, pageSize: limit);
  },
  onChanged: (value) {
    print("Selected value: $value");
  },
)

API Reference #

Main Properties #

  • controller: TextEditingController for managing the text input
  • enabled: Enables/disables the text field
  • isDropdown: Enables dropdown functionality
  • items: List of predefined dropdown items
  • getItems: Function for API-based item fetching
  • onChanged: Callback for value changes
  • validator: Form validation function
  • isObscured: Toggle password visibility
  • textFeildDecorator: Custom input decoration
DropdownMenuItems({
  required String lable,
  required String value,
})

Contributing #

Contributions are welcome! Please feel free to submit a Pull Request.

License #

This project is licensed under the MIT License - see the LICENSE file for details.

5
likes
0
points
5
downloads

Publisher

unverified uploader

Weekly Downloads

A simple textfeild which can be used to search the data in the list or can be used as simple dropdown widget

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on searchable_textfeild