buttonStyleFrom function
ButtonStyle
buttonStyleFrom({
- Color? foregroundColor,
- Color? backgroundColor,
- Color? hoverColor,
- Color? pressColor,
- Color? selectionColor,
- Color? focusColor,
- Color? shadowColor,
- double? elevation,
- TextStyle? textStyle,
- EdgeInsetsGeometry? padding,
- Size? minimumSize,
- Size? fixedSize,
- Size? maximumSize,
- BorderSide? side,
- OutlinedBorder? shape,
- MouseCursor? enabledMouseCursor,
- MouseCursor? disabledMouseCursor,
- VisualDensity? visualDensity,
- MaterialTapTargetSize? tapTargetSize,
- Duration? animationDuration,
- bool? enableFeedback,
- AlignmentGeometry? alignment,
- InteractiveInkFeatureFactory? splashFactory,
Implementation
ButtonStyle buttonStyleFrom({
Color? foregroundColor,
Color? backgroundColor,
Color? hoverColor,
Color? pressColor,
Color? selectionColor,
Color? focusColor,
Color? shadowColor,
double? elevation,
TextStyle? textStyle,
EdgeInsetsGeometry? padding,
Size? minimumSize,
Size? fixedSize,
Size? maximumSize,
BorderSide? side,
OutlinedBorder? shape,
MouseCursor? enabledMouseCursor,
MouseCursor? disabledMouseCursor,
VisualDensity? visualDensity,
MaterialTapTargetSize? tapTargetSize,
Duration? animationDuration,
bool? enableFeedback,
AlignmentGeometry? alignment,
InteractiveInkFeatureFactory? splashFactory,
}) {
final MaterialStateProperty<Color?>? foregroundColorStateProperty =
foregroundColor != null ? ButtonDefaultForeground(foregroundColor) : null;
final MaterialStateProperty<MouseCursor>? mouseCursor =
enabledMouseCursor != null && disabledMouseCursor != null ?
ButtonDefaultMouseCursor(enabledMouseCursor, disabledMouseCursor) : null;
return ButtonStyle(
textStyle: MaterialStatePropertyAll.orNull(textStyle),
backgroundColor: MaterialStatePropertyAll.orNull(backgroundColor),
foregroundColor: foregroundColorStateProperty,
overlayColor: ButtonRichStateProperty.onNull(hoverColor, pressColor, selectionColor, focusColor),
shadowColor: MaterialStatePropertyAll.orNull(shadowColor),
elevation: MaterialStatePropertyAll.orNull(elevation),
padding: MaterialStatePropertyAll.orNull(padding),
minimumSize: MaterialStatePropertyAll.orNull(minimumSize),
fixedSize: MaterialStatePropertyAll.orNull(fixedSize),
maximumSize: MaterialStatePropertyAll.orNull(maximumSize),
side: MaterialStatePropertyAll.orNull(side),
shape: MaterialStatePropertyAll.orNull(shape),
mouseCursor: mouseCursor,
visualDensity: visualDensity,
tapTargetSize: tapTargetSize,
animationDuration: animationDuration,
enableFeedback: enableFeedback,
alignment: alignment,
splashFactory: splashFactory,
);
}