CustomDropDownButton<T> constructor

const CustomDropDownButton<T>({
  1. required ButtonStyle buttonStyle,
  2. required String? buttonText,
  3. required List<CustomDropDownButtonItem<T>> menuItems,
  4. required Widget buttonIcon({
    1. required bool showedMenu,
    })?,
  5. Key? key,
  6. double menuVerticalSpacing = 8,
  7. Color menuBackgroundColor = Colors.grey,
  8. DropDownButtonPosition position = DropDownButtonPosition.bottomCenter,
  9. bool buttonIconFirst = true,
  10. EdgeInsets? menuPadding,
  11. BorderRadius? menuBorderRadius,
  12. TextStyle? buttonTextStyle,
  13. Widget customButton({
    1. required VoidCallback? showHideMenuEvent,
    2. required bool showMenu,
    })?,
  14. T? selectedValue,
  15. Color? buttonIconColor,
  16. Key? menuKey,
  17. double menuItemsSpacing = 0,
  18. double buttonIconSpace = 0,
  19. Widget? buttonChild,
})

Creates a CustomDropDownButton.

The buttonStyle, buttonText, and menuItems parameters are required.

Implementation

const CustomDropDownButton({
  required this.buttonStyle,
  required this.buttonText,
  required this.menuItems,
  required this.buttonIcon,
  Key? key,
  this.menuVerticalSpacing = 8,
  this.menuBackgroundColor = Colors.grey,
  this.position = DropDownButtonPosition.bottomCenter,
  this.buttonIconFirst = true,
  this.menuPadding,
  this.menuBorderRadius,
  this.buttonTextStyle,
  this.customButton,
  this.selectedValue,
  this.buttonIconColor,
  this.menuKey,
  this.menuItemsSpacing = 0,
  this.buttonIconSpace = 0,
  this.buttonChild,
})  : assert(
        !(buttonText == null && customButton == null && buttonChild == null),
        'Either provide a [buttonText] or a custom [customButton]'
        ' or a custom [buttonChild].',
      ),
      super(key: key);