패키지, 저장소 및 앱 카테고리 검색

drop_down_list 표지
패키지 상세v2.1.1

drop_down_list

단일/다중 선택을 지원하고 하단 시트에 통합된 검색 기능을 갖춘 사용자 정의 가능한 드롭다운 위젯이며, 사용자 정의 데이터에 대한 일반적인 지원을 통해 유연하고 타입 안전한 처리를 가능하게 합니다.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
3.2천
좋아요
350
Pub 점수
150

패키지 설치

flutter pub add drop_down_list

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

Flutter용 유연하고 사용자 정의 가능한 드롭다운 위젯으로 단일 및 다중 선택 모드를 지원합니다. 하단 시트 내에 통합된 검색 바를 통해 옵션을 효율적으로 필터링할 수 있습니다. 사용자 정의 데이터 타입을 처리하기 위한 제네릭 타입 안전성을 제공하여 강력하고 유지보수 가능한 코드를 보장합니다. 크로스플랫폼 사용을 위해 설계되어 Android, iOS, Web, macOS, Windows, Linux에서 원활하게 작동합니다. 양식, 필터 및 설정과 같이 사용자가 리스트에서 선택해야 하는 경우에 이상적입니다.

사용 사례

  • 동적 옵션을 가진 폼 입력
  • 대규모 데이터셋 필터링
  • 선택 가능한 설정 패널
  • 대시보드에서 다중 선택 드롭다운
  • 모바일 및 웹 앱에서 검색 가능한 목록

주요 기능

  • 단일 및 다중 선택을 지원합니다
  • 통합 검색 가능한 바텀 시트
  • 사용자 정의 데이터를 위한 제네릭 타입 안전성
  • 크로스 플랫폼 호환성
  • 사용자 정의 가능한 스타일 및 동작
  • 타입 안정성을 갖춘 유연한 데이터 처리

적합한 대상

  • 양식 중심 애플리케이션을 개발하는 개발자
  • 재사용 가능한 드롭다운 컴포넌트가 필요한 팀
  • 검색 가능한 선택이 필요한 프로젝트
  • 다중 플랫폼을 대상으로 하는 앱
  • 타입 안전한 드롭다운 로직을 원하는 사용자

고려 사항

  • 검색 기능을 위해 하단 시트와의 통합이 필요합니다
  • 복잡한 UI에는 추가적인 스타일링이 필요할 수 있습니다
  • 중간에서 대규모 옵션 세트에 가장 적합
  • 선택 외 내장 검증 기능은 제한적
  • 완전한 사용자 정의를 위해 외부 종속성에 의존합니다

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

drop_down_list

Flutter Website Dart Website MIT License

A customizable dropdown widget supporting single/multiple selection, integrated search in a bottom sheet, 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 item in selectedItems) {
        list.add(item.data);
      }
      ScaffoldMessenger.of(context).showSnackBar(
        SnackBar(
          content: Text(
            list.toString(),
          ),
        ),
      );
    },
  ),
).showModal(context);

Required parameters of DropDown

Parameter Description
List<SelectedListItem<T>> data The list of generic data items to be displayed in the dropdown

Optional parameters of DropDown

Parameter Description
ItemSelectionCallBack<T>? onSelected A callback function triggered when items are selected from the list
ListItemBuilder<T>? listItemBuilder A 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? maxSelectedItems The maximum number of items that can be selected when [enableMultipleSelection] is true
VoidCallback? onMaxSelectionReached A callback function triggered when the maximum selection limit is reached
EdgeInsets? listViewPadding The padding applied to the ListView that contains the dropdown items
Widget? listViewSeparatorWidget The widget used as a separator between items in the dropdown list
EdgeInsets? listTileContentPadding The padding applied to the content of each ListTile in the dropdown list
BottomSheetListener? bottomSheetListener A listener that monitors events bubbling up from the BottomSheet
EdgeInsets? dropDownPadding The padding applied to the dropdown container
EdgeInsets? dropDownHeaderPadding The padding applied to the dropdown header
Widget? bottomSheetTitle The widget displayed as the title of the bottom sheet
ButtonStyle? submitButtonStyle Defines a button style to display as the style of the submit button when [enableMultipleSelection] is true
ButtonStyle? clearButtonStyle Defines a button style to display as the style of the clear button when [enableMultipleSelection] is true
EdgeInsets? searchTextFieldPadding The padding applied to the search text field
TextFormField? searchWidget Defines a custom widget to display the text box for searching
EdgeInsets? selectAllTextButtonPadding The padding applied to the "select all" and "deselect all" TextButtons
Widget? selectAllTextButtonChild Defines a custom widget to display as the child of the selectAll text button when [enableMultipleSelection] and [isSelectAllVisible] is true
Widget? deSelectAllTextButtonChild Defines a custom widget to display as the child of the deSelectAll text button when [enableMultipleSelection] and [isSelectAllVisible] is true
SearchDelegate<T>? searchDelegate A delegate used to configure the custom search functionality in the dropdown

Optional parameters of DropDown with Default value

Parameter Default Description
bool enableMultipleSelection false Enables single or multiple selection for the drop down list items
Color listTileColor Colors.transparent Defines the background color of each ListTile in the dropdown list
Widget selectedListTileTrailingWidget Icon(Icons.check_box) The widget displayed as a trailing icon when a list item is selected
Widget deSelectedListTileTrailingWidget Icon(Icons.check_box_outline_blank) The widget displayed as a trailing icon when a list item is not selected
bool useRootNavigator false Specifies whether a modal bottom sheet should be displayed using the root navigator
bool enableDrag true Specifies whether the bottom sheet can be dragged up and down and dismissed by swiping downwards
bool isDismissible true Specifies whether the bottom sheet will be dismissed when the user taps on the scrim
double initialChildSize 0.7 The initial fractional value of DraggableScrollableSheet
double minChildSize 0.3 The minimum fractional value of DraggableScrollableSheet
double maxChildSize 0.9 The maximum fractional value of DraggableScrollableSheet
Color dropDownBackgroundColor Colors.transparent Sets 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 isSearchVisible true Controls the visibility of the search widget
String searchHintText 'Search' Specifies the text displayed on the search widget as hint text
Color searchFillColor Colors.black12 This is the fill color for the input field
Color searchCursorColor Colors.black This is the cursor color for the input field
bool isSelectAllVisible true Controls 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

Parameter Description
DropDown<T> dropDown The DropDown configuration object that defines the behavior, appearance, and other properties of the dropdown menu

Optional parameters of DropDownState

Parameter Description
ShapeBorder? shapeBorder The shape of the bottom sheet

Method of DropDownState

Method Description
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 pull requests 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 when reporting:

  • 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_list is MIT-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 to [sales@mindinventory.com](mailto:sales@mindinventory.com) And do let us know if you have any questions or suggestion regarding our work.

Visit our website mindinventory.com

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

flutter app development

카테고리

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.