Flutter DropDown

pub package

A dropdown that allows you to customized dropdown list items.

Features

  • List Items can be added dropdown list.
  • Support customizable expanded dropdown list.
  • All fields from ListView.sepeared constructor available.

Getting Started

Add the package to your pubspec.yaml:

 customizable_dropdown: ^0.0.1

In your dart file, import the library:

import 'package:customizable_dropdown/customizable_dropdown.dart';

Instead of using a DropdownButton create a CustomDropdown Widget:

Result:

In action

   List<String> dropdownList = [
    'Walmart',
    'Amazon',
    'Apple Inc.',
    'CVS Health',
    'ExxonMobil',
    'UnitedHealth Group',
    'Berkshire Hathaway',
    'McKesson Corporation'
  ]
  
  CustomDropdown(icon: 
  const Icon(
   Icons.keyboard_arrow_right,color: Colors.black,),
   titleAlign: TextAlign.center,
   decoration: BoxDecoration(
   color: Colors.white,
   borderRadius: const BorderRadius.all(Radius.circular(10)),
   boxShadow: [ BoxShadow(
   color: Colors.grey.withOpacity(0.5),
   spreadRadius: 0,
   blurRadius: 5,
   offset:
   const Offset(1, 1)),],),
   itemList: dropdownList,
   onSelectedItem: (sele) {},
   placeholder: const Text("List of largest companies"))

Parameters:

ParamsRequiredinput
itemListRequiredList
placeholderRequiredText
onSelectedItemRequiredFunction
maxHeightoptionalList
heightoptionalText
widthoptionalFunction
decorationoptionalList
crossAxisAlignmentoptionalText
mainAxisAlignmentoptionalFunction
iconoptionalList
listTitleoptionalText
seperatoroptionalFunction
colorDropDownoptionalList
constraintsDropDownoptionalText
dropDownPaddingoptionalFunction
marginDropDownoptionalText
listColoroptionalFunction
titleAlignoptionalList
titleStyleoptionalText

Contributions

Contributions of any kind are more than welcome! Feel free to fork and improve customizable_dropdown in any way you want, make a pull request, or open an issue.

Libraries

customizable_dropdown
expand_section