dropdown_plus_bloc library

dropdown_plus — A customizable Flutter dropdown package with BLoC integration.

This library provides two powerful dropdown widgets:

Quick Start

import 'package:dropdown_plus/dropdown_plus.dart';

Single Select

SearchableDropdownPlus<MyCubit, MyState>(
  cubit: myCubit,
  hintText: 'Search and select...',
  onSearch: myCubit.search,
  onStateChange: (state, updateList, updateLoading) {
    if (state is MyLoadedState) {
      updateList(state.items.map((e) => DropdownItem(value: e, label: e.name)).toList());
      updateLoading(false);
    } else if (state is MyLoadingState) {
      updateLoading(true);
    }
  },
  onSelectionChanged: (item) => print('Selected: ${item.label}'),
);

Multi Select

MultiSelectDropdownPlus<MyCubit, MyState>(
  cubit: myCubit,
  hintText: 'Select items...',
  onSearch: myCubit.search,
  onStateChange: (state, updateList, updateLoading) {
    if (state is MyLoadedState) {
      updateList(state.items.map((e) => DropdownItem(value: e, label: e.name)).toList());
      updateLoading(false);
    } else if (state is MyLoadingState) {
      updateLoading(true);
    }
  },
  onSelectionChanged: (items) => print('Selected: ${items.map((e) => e.label).join(', ')}'),
);

Classes

A generic model representing a single item in a SearchableDropdownPlus or MultiSelectDropdownPlus dropdown list.
Defines the visual theme for SearchableDropdownPlus and MultiSelectDropdownPlus widgets.
Provides ready-made DropdownPlusTheme instances for each DropdownPlusThemeStyle.
MultiSelectDropdownPlus<C extends StateStreamableSource<S>, S>
A multi-select dropdown that integrates with any BLoC/Cubit.
SearchableDropdownPlus<C extends StateStreamableSource<S>, S>
A single-select searchable dropdown that integrates with any BLoC/Cubit.