Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Highly versatile Widget to search through a single or multiple choices from bottom sheet list in a dialog box or a menu.

License

NotificationsYou must be signed in to change notification settings

Mindinventory/drop_down_list

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

152 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flutter WebsiteDart WebsiteMIT License

A customizable dropdown widget supporting single/multiple selection, integrated search in a bottomsheet, generic support for flexible, type-safe handling of custom data.

Preview

Dropdown with a Multiple Selection

drop_down_with_multiple_selection

Dropdown with a Single Selection

drop_down_with_single_selection

Basic Usage

Import it to your project file

import'package:drop_down_list/drop_down_list.dart';

And add it in its most basic form like it:

DropDownState<String>(  dropDown:DropDown<String>(    data:<SelectedListItem<String>>[SelectedListItem<String>(data:'Tokyo'),SelectedListItem<String>(data:'New York'),SelectedListItem<String>(data:'London'),    ],    onSelected: (selectedItems) {List<String> list= [];for (var itemin selectedItems) {        list.add(item.data);      }ScaffoldMessenger.of(context).showSnackBar(SnackBar(          content:Text(            list.toString(),          ),        ),      );    },  ),).showModal(context);

Required parameters of DropDown

ParameterDescription
List<SelectedListItem<T>> dataThe list of generic data items to be displayed in the dropdown

Optional parameters of DropDown

ParameterDescription
ItemSelectionCallBack<T>? onSelectedA callback function triggered when items are selected from the list
ListItemBuilder<T>? listItemBuilderA function that takes an[index] and[dataItem] as a parameter and returns a custom widget to display for the list item at that index
int? maxSelectedItemsThe maximum number of items that can be selected when[enableMultipleSelection] is true
VoidCallback? onMaxSelectionReachedA callback function triggered when the maximum selection limit is reached
EdgeInsets? listViewPaddingThe padding applied to theListView that contains the dropdown items
Widget? listViewSeparatorWidgetThe widget used as a separator between items in the dropdown list
EdgeInsets? listTileContentPaddingThe padding applied to the content of eachListTile in the dropdown list
BottomSheetListener? bottomSheetListenerA listener that monitors events bubbling up from the BottomSheet
EdgeInsets? dropDownPaddingThe padding applied to the dropdown container
EdgeInsets? dropDownHeaderPaddingThe padding applied to the dropdown header
Widget? bottomSheetTitleThe widget displayed as the title of the bottom sheet
ButtonStyle? submitButtonStyleDefines a button style to display as the style of the submit button when[enableMultipleSelection] is true
ButtonStyle? clearButtonStyleDefines a button style to display as the style of the clear button when[enableMultipleSelection] is true
EdgeInsets? searchTextFieldPaddingThe padding applied to the search text field
TextFormField? searchWidgetDefines a custom widget to display the text box for searching
EdgeInsets? selectAllTextButtonPaddingThe padding applied to the "select all" and "deselect all" TextButtons
Widget? selectAllTextButtonChildDefines a custom widget to display as the child of the selectAll text button when[enableMultipleSelection] and[isSelectAllVisible] is true
Widget? deSelectAllTextButtonChildDefines a custom widget to display as the child of the deSelectAll text button when[enableMultipleSelection] and[isSelectAllVisible] is true
SearchDelegate<T>? searchDelegateA delegate used to configure the custom search functionality in the dropdown

Optional parameters of DropDown with Default value

ParameterDefaultDescription
bool enableMultipleSelectionfalseEnables single or multiple selection for the drop down list items
Color listTileColorColors.transparentDefines the background color of eachListTile in the dropdown list
Widget selectedListTileTrailingWidgetIcon(Icons.check_box)The widget displayed as a trailing icon when a list item is selected
Widget deSelectedListTileTrailingWidgetIcon(Icons.check_box_outline_blank)The widget displayed as a trailing icon when a list item is not selected
bool useRootNavigatorfalseSpecifies whether a modal bottom sheet should be displayed using the root navigator
bool enableDragtrueSpecifies whether the bottom sheet can be dragged up and down and dismissed by swiping downwards
bool isDismissibletrueSpecifies whether the bottom sheet will be dismissed when the user taps on the scrim
double initialChildSize0.7The initial fractional value of DraggableScrollableSheet
double minChildSize0.3The minimum fractional value of DraggableScrollableSheet
double maxChildSize0.9The maximum fractional value of DraggableScrollableSheet
Color dropDownBackgroundColorColors.transparentSets the background color of the dropdown
String submitButtonText'Submit'Specifies the text displayed on the submit button when[enableMultipleSelection] is true
String clearButtonText'Clear'Specifies the text displayed on the clear button when[enableMultipleSelection] is true
bool isSearchVisibletrueControls the visibility of the search widget
String searchHintText'Search'Specifies the text displayed on the search widget as hint text
Color searchFillColorColors.black12This is the fill color for the input field
Color searchCursorColorColors.blackThis is the cursor color for the input field
bool isSelectAllVisibletrueControls the visibility of the "select all" widget when[enableMultipleSelection] is true
String selectAllButtonText'Select All'Specifies the text displayed on the selectAll text button when[enableMultipleSelection] and[isSelectAllVisible] is true
String deSelectAllButtonText'Deselect All'Specifies the text displayed on the deSelectAll text button when[enableMultipleSelection] and[isSelectAllVisible] is true

Required parameters of DropDownState

ParameterDescription
DropDown<T> dropDownTheDropDown configuration object that defines the behavior, appearance, and other properties of the dropdown menu

Optional parameters of DropDownState

ParameterDescription
ShapeBorder? shapeBorderThe shape of the bottom sheet

Method of DropDownState

MethodDescription
void showModal(BuildContext context)Displays the dropdown menu as a modal bottom sheet

Guideline for contributors

  • Contributions to our repository are always welcome! We encourage contributors to submit pullrequests for development and improvements.

Guideline for Reporting an Issue or Feature Request

To help us better understand and resolve the issue, please include the following details whenreporting:

  • Library version
  • Code snippet
  • Logs (if applicable)
  • Device specifications (e.g., manufacturer, OS version)
  • Screenshot or video with steps to reproduce the issue
  • Any other relevant libraries used

LICENSE!

drop_down_listisMIT-licensed.

Let us know!

We’d be really happy if you send us links to your projects where you use our open-source libraries.Just send an email tosales@mindinventory.com And do let us knowif you have any questions or suggestion regarding our work.

Visit our websitemindinventory.com

Let us know if you are interested to building Apps or Designing Products.

flutter app development

About

Highly versatile Widget to search through a single or multiple choices from bottom sheet list in a dialog box or a menu.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors12


[8]ページ先頭

©2009-2026 Movatter.jp