RawMaterialButtonModifier constructor
const
RawMaterialButtonModifier({
- Key? key,
- Widget? child,
- Key? modifierKey,
- required VoidCallback? onPressed,
- VoidCallback? onLongPress,
- ValueChanged<
bool> ? onHighlightChanged, - MouseCursor? mouseCursor,
- TextStyle? textStyle,
- Color? fillColor,
- Color? focusColor,
- Color? hoverColor,
- Color? highlightColor,
- Color? splashColor,
- double elevation = 2.0,
- double focusElevation = 4.0,
- double hoverElevation = 4.0,
- double highlightElevation = 8.0,
- double disabledElevation = 0.0,
- EdgeInsetsGeometry padding = EdgeInsets.zero,
- VisualDensity visualDensity = VisualDensity.standard,
- BoxConstraints constraints = const BoxConstraints(minWidth: 88.0, minHeight: 36.0),
- ShapeBorder shape = const RoundedRectangleBorder(),
- Duration animationDuration = kThemeChangeDuration,
- Clip clipBehavior = Clip.none,
- FocusNode? focusNode,
- bool autofocus = false,
- MaterialTapTargetSize? materialTapTargetSize,
- 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;