ContextMenuButton<T>.filled constructor

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

Creates a button with a filled background.

Implementation

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