RawMaterialButtonModifier constructor

const RawMaterialButtonModifier({
  1. Key? key,
  2. Widget? child,
  3. Key? modifierKey,
  4. required VoidCallback? onPressed,
  5. VoidCallback? onLongPress,
  6. ValueChanged<bool>? onHighlightChanged,
  7. MouseCursor? mouseCursor,
  8. TextStyle? textStyle,
  9. Color? fillColor,
  10. Color? focusColor,
  11. Color? hoverColor,
  12. Color? highlightColor,
  13. Color? splashColor,
  14. double elevation = 2.0,
  15. double focusElevation = 4.0,
  16. double hoverElevation = 4.0,
  17. double highlightElevation = 8.0,
  18. double disabledElevation = 0.0,
  19. EdgeInsetsGeometry padding = EdgeInsets.zero,
  20. VisualDensity visualDensity = VisualDensity.standard,
  21. BoxConstraints constraints = const BoxConstraints(minWidth: 88.0, minHeight: 36.0),
  22. ShapeBorder shape = const RoundedRectangleBorder(),
  23. Duration animationDuration = kThemeChangeDuration,
  24. Clip clipBehavior = Clip.none,
  25. FocusNode? focusNode,
  26. bool autofocus = false,
  27. MaterialTapTargetSize? materialTapTargetSize,
  28. bool enableFeedback = true,
})

Create a button based on Semantics, Material, and InkWell widgets.

The shape, elevation, focusElevation, hoverElevation, highlightElevation, disabledElevation, padding, constraints, autofocus, and clipBehavior arguments must not be null. Additionally, elevation, focusElevation, hoverElevation, highlightElevation, and disabledElevation must be non-negative.

Implementation

const RawMaterialButtonModifier({
  super.key,
  super.child,
  super.modifierKey,
  required this.onPressed,
  this.onLongPress,
  this.onHighlightChanged,
  this.mouseCursor,
  this.textStyle,
  this.fillColor,
  this.focusColor,
  this.hoverColor,
  this.highlightColor,
  this.splashColor,
  this.elevation = 2.0,
  this.focusElevation = 4.0,
  this.hoverElevation = 4.0,
  this.highlightElevation = 8.0,
  this.disabledElevation = 0.0,
  this.padding = EdgeInsets.zero,
  this.visualDensity = VisualDensity.standard,
  this.constraints = const BoxConstraints(minWidth: 88.0, minHeight: 36.0),
  this.shape = const RoundedRectangleBorder(),
  this.animationDuration = kThemeChangeDuration,
  this.clipBehavior = Clip.none,
  this.focusNode,
  this.autofocus = false,
  MaterialTapTargetSize? materialTapTargetSize,
  this.enableFeedback = true,
})  : materialTapTargetSize = materialTapTargetSize ?? MaterialTapTargetSize.padded;