RawMaterialButton constructor

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