DropdownMenuButton.material constructor

DropdownMenuButton.material({
  1. Key? key,
  2. Color? iconColor,
  3. double iconSize = 24,
  4. IconData? iconData,
  5. required DropdownMenuButtonBuilder builder,
  6. required int itemCount,
  7. required DropdownMenuButtonIndexBuilder itemBuilder,
  8. ValueCallback<int>? onChanged,
  9. Color? backgroundColor,
  10. Decoration? decoration,
  11. EdgeInsetsGeometry? margin,
  12. EdgeInsetsGeometry? padding = const EdgeInsets.symmetric(horizontal: 4),
})

Implementation

DropdownMenuButton.material({
  super.key,
  Color? iconColor,
  double iconSize = 24,
  IconData? iconData,
  required this.builder,
  required this.itemCount,
  required DropdownMenuButtonIndexBuilder itemBuilder,
  this.onChanged,
  this.backgroundColor,
  this.decoration,
  this.margin,
  this.padding = const EdgeInsets.symmetric(horizontal: 4),
})  : icon = Icon(iconData ?? Icons.arrow_right_rounded,
          color: iconColor, size: iconSize),
      itemBuilder = ((int index) =>
          itemBuilder(index).paddingSymmetric(vertical: 8, horizontal: 4));