cool_dropdown 2.1.1

SDKflutter
Platformandroidioswindowslinuxmacosweb

Customizable cool dropdown UI You can customize selected item, BoxDecoration of the dropdownBox, and dropdown input.

Cool drop down

pub package version

Features

  • All customizable style(font, fontsize. color, icon, result, dropdown decoration...).

  • Auto scroll to selected item position.

  • Dropdown is automatically placed. It's based on the position of the result on the screen(top/bottom).

  • Marquee effect.

  • Customizable animation.

  • Error handling.

  • "COOL"

Samples

Installing

command:

 $ flutter pub add cool_dropdown

pubspec.yaml:

dependencies:
  cool_dropdown: ^(latest)

Cool Dropdown options

OptionTypeDefaultDescription
dropdownListList<CoolDropdownItem>[]Dropdown item list.
defaultItemCoolDropdownItem?nullDefault item of the dropdown.
onChangeFunction(T)requiredWhen user selects one of the items, you will get T type value.
onOpenFunction(bool)nullWhen user either open or close the dropdown, you will get bool value.
resultOptionsResultOptions-
dropdownOptionsDropdownOptions-Check below.
dropdownItemOptionsDropdownItemOptions-Check below.
dropdownTriangleOptionsDropdownTriangleOptions-Check below.
dropdownControllerDropdownControllerrequiredCheck below.

Result Options(result<v1.3.0> -> ResultOptions<v.2.0.0>)

OptionTypeDefaultDescription
widthdouble220
heightdouble50
spacedouble10Space between (label + icon) and arrow icon.
paddingEdgeInsetsEdgeInsets.zero
alignmentAlignmentAlignment.centerAlignment of (label + icon).
renderResultRenderResultRender.allSet the order of the result elements to render.
boxDecorationBoxDecorationBoxDecoration of the result box.
openBoxDecorationBoxDecorationBoxDecoration of when result box is open.
errorBoxDecorationBoxDecorationBoxDecoration of when result box is on error.
textStyleTextStyleTextStyle of the label in result box.
placeholderTextStyleTextStyleTextStyle of the placeholder in result box.
textOverflowTextOverFlowTextOverflow of the label in result box.
isMarqueeboolfalseA marquee effect when the label overflows.
durationDurationDuration(milliseconds: 300)When dropdown value is changed.
marqueeDurationDurationDuration(milliseconds: 6000)Duration of the marquee effect
backDurationDurationDuration(milliseconds: 800)Reverse animation duration of the marquee effect
pauseDurationDurationDuration(milliseconds: 800)Pause duration after marquee effect.
OptionTypeDefaultDescription
widthdouble?result widthDropdown width.
heightdouble50Dropdown height.
topdouble0Top position of the dropdown.
leftdouble0Left position of the dropdown.
colorColorColors.whiteDropdown color.
borderRadiusBorderRadiusBorderRadius.all(Radius.circular(10))BorderRadius of the dropdown.
shadowList[]BoxShadow list of the dropdown.
animationTypeDropdownAnimationTypeDropdownAnimationType.scaleAnimation type of the dropdown.
alignDropdownAlignDropdownAlign.centerThe alignment of the dropdown. If the dropdown and result box are different sizes, the dropdown will be aligned to the result box.
alignSelectedItemAlignSelectedItemAlign.centerThe scroll alignment of the selected item in the dropdown.
gapDropdownGapDropdownGap.zeroThe gap between the dropdown and dropdown items.
paddingEdgeInsetsEdgeInsets.zero
durationDurationDuration(milliseconds: 300)Duration of the dropdown scroll animation.
curveCurveCurves.easeInOutCurve of the dropdown scroll animation.
OptionTypeDefaultDescription
heightdouble50Dropdown item height.
paddingEdgeInsetsEdgeInsets.symmetric(horizontal: 10)Padding of the dropdown item.
alignmentAlignmentAlignment.centerLeftVertical alignment of the dropdown item.
mainAxisAlignmentMainAxisAlignmentMainAxisAlignment.startHorizontal alignment of the dropdown item(label + icon).
renderDropdownItemRenderDropdownItemRender.allSet the order of the dropdown item elements to render.
boxDecorationBoxDecorationBoxDecoration of the result box.
selectedBoxDecorationBoxDecorationBoxDecoration of when dropdown item is selected.
textStyleTextStyleTextStyle of the label in dropdown item.
selectedTextStyleTextStyleSelected TextStyle of the label in dropdown item.
textOverflowTextOverFlowTextOverflow of the label in dropdown item.
isMarqueeboolfalseA marquee effect when the label overflows.
durationDurationDuration(milliseconds: 300)When dropdown value is changed.
marqueeDurationDurationDuration(milliseconds: 6000)Duration of the marquee effect
backDurationDurationDuration(milliseconds: 800)Reverse animation duration of the marquee effect
pauseDurationDurationDuration(milliseconds: 800)Pause duration after marquee effect.
OptionTypeDefaultDescription
widthdouble10Triangle width of the dropdown.
heightdouble10Triangle height of the dropdown.
leftdouble0Left position of the triangle.
borderRadiusBorderRadius0BorderRadius of the triangle.
alignDropdownTriangleAlignDropdownTriangleAlign.centerAlignment of the triangle on the dropdown.
OptionTypeDefaultDescription
durationDurationDuration(milliseconds: 500)Dropdown staggered animation duration.
errorDurationDurationDuration(milliseconds: 500)Result box decoration error animation duration.
resultArrowIntervalIntervalInterval(0.0, 0.5, curve: Curves.easeOut)Result arrow animation interval.
resultBoxIntervalIntervalInterval(0.0, 0.5, curve: Curves.easeOut)Result box animation interval.
showDropdownIntervalIntervalInterval(0.5, 1.0, curve: Curves.easeOut)Show dropdown animation interval.
showErrorCurveCurveCurves.easeInShow error animation curve.
openmethod-Open the dropdown.
closemethod-Close the dropdown.
errormethod-Occur an error of the dropdown.
resetErrormethod-Reset an error of the dropdown.
resetValuemethod-Reset the value of the dropdown.