RaisedButton constructor

const RaisedButton(
  1. {Key key,
  2. @required VoidCallback onPressed,
  3. VoidCallback onLongPress,
  4. ValueChanged<bool> onHighlightChanged,
  5. ButtonTextTheme textTheme,
  6. Color textColor,
  7. Color disabledTextColor,
  8. Color color,
  9. Color disabledColor,
  10. Color focusColor,
  11. Color hoverColor,
  12. Color highlightColor,
  13. Color splashColor,
  14. Brightness colorBrightness,
  15. double elevation,
  16. double focusElevation,
  17. double hoverElevation,
  18. double highlightElevation,
  19. double disabledElevation,
  20. EdgeInsetsGeometry padding,
  21. VisualDensity visualDensity,
  22. ShapeBorder shape,
  23. Clip clipBehavior: Clip.none,
  24. FocusNode focusNode,
  25. bool autofocus: false,
  26. MaterialTapTargetSize materialTapTargetSize,
  27. Duration animationDuration,
  28. Widget child}

Create a filled button.

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


const RaisedButton({
  Key key,
  @required VoidCallback onPressed,
  VoidCallback onLongPress,
  ValueChanged<bool> onHighlightChanged,
  ButtonTextTheme textTheme,
  Color textColor,
  Color disabledTextColor,
  Color color,
  Color disabledColor,
  Color focusColor,
  Color hoverColor,
  Color highlightColor,
  Color splashColor,
  Brightness colorBrightness,
  double elevation,
  double focusElevation,
  double hoverElevation,
  double highlightElevation,
  double disabledElevation,
  EdgeInsetsGeometry padding,
  VisualDensity visualDensity,
  ShapeBorder shape,
  Clip clipBehavior = Clip.none,
  FocusNode focusNode,
  bool autofocus = false,
  MaterialTapTargetSize materialTapTargetSize,
  Duration animationDuration,
  Widget child,
}) : assert(autofocus != 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(clipBehavior != null),
       key: key,
       onPressed: onPressed,
       onLongPress: onLongPress,
       onHighlightChanged: onHighlightChanged,
       textTheme: textTheme,
       textColor: textColor,
       disabledTextColor: disabledTextColor,
       color: color,
       disabledColor: disabledColor,
       focusColor: focusColor,
       hoverColor: hoverColor,
       highlightColor: highlightColor,
       splashColor: splashColor,
       colorBrightness: colorBrightness,
       elevation: elevation,
       focusElevation: focusElevation,
       hoverElevation: hoverElevation,
       highlightElevation: highlightElevation,
       disabledElevation: disabledElevation,
       padding: padding,
       visualDensity: visualDensity,
       shape: shape,
       clipBehavior: clipBehavior,
       focusNode: focusNode,
       autofocus: autofocus,
       materialTapTargetSize: materialTapTargetSize,
       animationDuration: animationDuration,
       child: child,