🧺 searchable_dropdown_sheet

A fully customizable, searchable dropdown modal sheet for Flutter β€” powered by the modal_bottom_sheet package.

Perfect for dropdown selection with search functionality in a beautiful bottom sheet layout.


✨ Features

  • πŸ” Searchable: Built-in search field with filtering
  • 🎨 Customizable: Override item builder, search field, separator, styles, and more
  • πŸ“± Responsive UI: Clean modal sheet experience across devices
  • 🧩 Plug & Play: Just pass a list of items and a callback β€” you're done!

πŸš€ Installation

Add the package to your pubspec.yaml:

dependencies:
  searchable_dropdown_sheet: ^0.0.1

Then run:

flutter pub get

πŸ“¦ Import

import 'package:searchable_dropdown_sheet/searchable_dropdown_sheet.dart';

πŸ› οΈ Usage

showBarModalBottomSheet(
  context: context,
  builder: (_) => SearchableDropdownSheet(
    title: 'Choose Fruit',
    subtitle: 'Search or scroll to select',
    items: ['Apple', 'Banana', 'Mango'],
    selectedItem: _controller.text,
    onItemSelected: (value) {
      setState(() => _controller.text = value);
    },
  ),
);

🎯 Advanced Customization

SearchableDropdownSheet(
  title: 'Pick a Fruit',
  subtitle: 'Search and select',
  items: ['Apple', 'Banana', 'Orange'],
  selectedItem: selected,
  onItemSelected: (value) => setState(() => selected = value),

  // Custom search input
  customSearchField: Padding(
    padding: const EdgeInsets.only(bottom: 12),
    child: TextFormField(
      decoration: InputDecoration(
        hintText: 'Type to search...',
        prefixIcon: Icon(Icons.search),
        border: OutlineInputBorder(),
      ),
    ),
  ),

  // Custom item display
  itemBuilder: (context, item, isSelected) => ListTile(
    title: Text(item),
    trailing: isSelected ? Icon(Icons.check, color: Colors.green) : null,
  ),

  // Custom empty result
  emptyBuilder: (context) => Center(
    child: Text('❌ No match found'),
  ),
)

πŸ“š Parameters

Parameter Type Description
title String Top title inside the modal
subtitle String Optional subtitle below the title
items List<String> List of items to display
selectedItem String Currently selected item
onItemSelected Function(String) Callback when item is tapped
customSearchField Widget? Provide your own search field widget
itemBuilder Widget Function(...) Custom builder for list items
emptyBuilder Widget Function(BuildContext) Widget to show when no results found
separatorBuilder Widget Function(...) Customize list separator

πŸ“Œ Dependencies


πŸ“„ License

This package is licensed under the MIT License.


πŸ’™ Created by

Nadim Chowdhury
β†’ GitHub
β†’ LinkedIn


PRs and contributions are welcome!