ButtonThemeData constructor Null safety

const ButtonThemeData(
  1. {ButtonTextTheme textTheme = ButtonTextTheme.normal,
  2. double minWidth = 88.0,
  3. double height = 36.0,
  4. EdgeInsetsGeometry? padding,
  5. ShapeBorder? shape,
  6. ButtonBarLayoutBehavior layoutBehavior = ButtonBarLayoutBehavior.padded,
  7. bool alignedDropdown = false,
  8. Color? buttonColor,
  9. Color? disabledColor,
  10. Color? focusColor,
  11. Color? hoverColor,
  12. Color? highlightColor,
  13. Color? splashColor,
  14. ColorScheme? colorScheme,
  15. MaterialTapTargetSize? materialTapTargetSize}
)

Create a button theme object that can be used with ButtonTheme or ThemeData.

The textTheme, minWidth, height, alignedDropdown, and layoutBehavior parameters must not be null. The minWidth and height parameters must greater than or equal to zero.

The ButtonTheme's methods that have a MaterialButton parameter and have a name with a get prefix are used to configure a RawMaterialButton.

Implementation

const ButtonThemeData({
  this.textTheme = ButtonTextTheme.normal,
  this.minWidth = 88.0,
  this.height = 36.0,
  EdgeInsetsGeometry? padding,
  ShapeBorder? shape,
  this.layoutBehavior = ButtonBarLayoutBehavior.padded,
  this.alignedDropdown = false,
  Color? buttonColor,
  Color? disabledColor,
  Color? focusColor,
  Color? hoverColor,
  Color? highlightColor,
  Color? splashColor,
  this.colorScheme,
  MaterialTapTargetSize? materialTapTargetSize,
}) : assert(textTheme != null),
     assert(minWidth != null && minWidth >= 0.0),
     assert(height != null && height >= 0.0),
     assert(alignedDropdown != null),
     assert(layoutBehavior != null),
     _buttonColor = buttonColor,
     _disabledColor = disabledColor,
     _focusColor = focusColor,
     _hoverColor = hoverColor,
     _highlightColor = highlightColor,
     _splashColor = splashColor,
     _padding = padding,
     _shape = shape,
     _materialTapTargetSize = materialTapTargetSize;