πŸ“¦ clever_dropdown

A highly customizable and powerful dropdown widget for Flutter with:

  • πŸ” Real-time search
  • βœ… Single & Multi-selection
  • βž• Support for adding new items
  • ⚑ Async item loading

clever_dropdown is perfect for forms, filters, settings, and searchable dropdown fields in Flutter apps β€” works across Android, iOS, Web, and Desktop.


πŸš€ Features

  • πŸ”Ή Single-selection dropdown
  • πŸ”Έ Multi-selection with checkboxes
  • πŸ” Real-time filtering and search
  • βž• Dynamic "Add new" option
  • 🌐 Async data fetching
  • ⌨️ Keyboard navigation (Arrow ↑ ↓ + Enter)
  • 🧩 Custom styling (radius, color, icons, borders)

πŸ“₯ Installation

Add this to your pubspec.yaml:

dependencies:
  clever_dropdown: latest_version

πŸ”§ Usage

βœ… Single Selection
CleverDropdown<String>(
  items: ['Apple', 'Banana', 'Orange'],
  value: 'Banana',
  onChanged: (value) {
    print('Selected: $value');
  },
  hintText: 'Select fruit',
  isMultiple: false,
)
βœ… Multi Selection
CleverDropdown<String>(
  items: ['Red', 'Green', 'Blue'],
  isMultiple: true, // Make this true 
  initialValues: ['Red'],
  onChanged: (values) {
    print('Selected Colors: $values');
  },
  hintText: 'Select colors',
)
πŸ§™ Create New Item

CleverDropdown<String>(
  ...
  onCreateTap: (newValue) {
    print("Create tapped with value: $newValue");
    // Add it to your backend or list
  },
)

🧾 Parameters

Parameter Type Required Default Description
items List<T> No [] List of options for dropdown
asyncItems Future<List<T>> Function() No null Fetch items asynchronously
hintText String No 'Select' Placeholder text
isMultiple bool No false Enable multi-selection
onChanged void Function(dynamic) Yes null Callback for selection changes
onCreateTap void Function(String) No null Callback for adding new item (on Enter or tap)
itemAsString String Function(T) No null Converts item to displayable string
enableAddItem bool No false Allow adding new values dynamically
maxListHeight double No 200.0 Max height of dropdown list
smoothBorderRadius SmoothBorderRadius No default Custom smooth border radius using figma_squircle
dropdownColor Color No Colors.white Dropdown background color
borderColor Color No Colors.grey Outline border color
showDropdownOnlyOnSearch bool No false Show dropdown only when user types something

Libraries

clever_dropdown