ButtonStyle.from constructor

ButtonStyle.from({
  1. Color? foregroundColor,
  2. Color? disabledForegroundColor,
  3. Color? backgroundColor,
  4. Color? disabledBackgroundColor,
  5. TextStyle? textStyle,
  6. OutlinedBorder? shape,
  7. EdgeInsetsGeometry? padding,
  8. Size? minimumSize,
  9. Size? fixedSize,
  10. Size? maximumSize,
  11. double? iconSize,
  12. VisualDensity? visualDensity,
  13. TapTargetSize? tapTargetSize,
  14. ButtonLayerBuilder? backgroundBuilder,
  15. PressLook? pressLook,
  16. bool? ringStandsOff,
})

Leaves an unset disabled color to the theme and the defaults.

Implementation

factory ButtonStyle.from({
  Color? foregroundColor,
  Color? disabledForegroundColor,
  Color? backgroundColor,
  Color? disabledBackgroundColor,
  TextStyle? textStyle,
  OutlinedBorder? shape,
  EdgeInsetsGeometry? padding,
  Size? minimumSize,
  Size? fixedSize,
  Size? maximumSize,
  double? iconSize,
  VisualDensity? visualDensity,
  TapTargetSize? tapTargetSize,
  ButtonLayerBuilder? backgroundBuilder,
  PressLook? pressLook,
  bool? ringStandsOff,
}) => ButtonStyle(
  foregroundColor: _byEnabled(foregroundColor, disabledForegroundColor),
  backgroundColor: _byEnabled(backgroundColor, disabledBackgroundColor),
  textStyle: textStyle,
  shape: shape,
  padding: padding,
  minimumSize: minimumSize,
  fixedSize: fixedSize,
  maximumSize: maximumSize,
  iconSize: iconSize,
  visualDensity: visualDensity,
  tapTargetSize: tapTargetSize,
  backgroundBuilder: backgroundBuilder,
  pressLook: pressLook,
  ringStandsOff: ringStandsOff,
);