ContextMenuButton<T>.dropdown constructor

ContextMenuButton<T>.dropdown(
  1. Widget body, {
  2. Key? key,
  3. String? tooltip,
  4. EdgeInsets? padding,
  5. FocusNode? focusNode,
  6. bool canRequestFocus = true,
  7. bool autofocus = false,
  8. bool willChangeState = false,
  9. VoidCallback? onLongPress,
  10. ButtonThemeData? theme,
  11. T? value,
  12. ContextMenuCanceled? onCanceled,
  13. required ContextMenuItemSelected<T>? onSelected,
  14. required ContextMenuItemBuilder<T> itemBuilder,
})

Creates a dropdown button. The difference with a regular DropdownButton, is that a widget will be used alongside the icon instead of the context menu value.

Implementation

factory ContextMenuButton.dropdown(
  Widget body, {
  Key? key,
  String? tooltip,
  EdgeInsets? padding,
  FocusNode? focusNode,
  bool canRequestFocus = true,
  bool autofocus = false,
  bool willChangeState = false,
  VoidCallback? onLongPress,
  ButtonThemeData? theme,
  T? value,
  ContextMenuCanceled? onCanceled,
  required ContextMenuItemSelected<T>? onSelected,
  required ContextMenuItemBuilder<T> itemBuilder,
}) {
  return _ContextMenuButtonDropdown(
    key: key,
    padding: padding,
    bodyPadding: padding != null ? EdgeInsets.zero : null,
    theme: theme,
    tooltip: tooltip,
    onLongPress: onLongPress,
    focusNode: focusNode,
    canRequestFocus: canRequestFocus,
    autofocus: autofocus,
    willChangeState: willChangeState,
    enableAnimation: true,
    value: value,
    itemBuilder: itemBuilder,
    onCanceled: onCanceled,
    onSelected: onSelected,
    body: body,
  );
}