๐Ÿงบ 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!