copyWith method
- WidgetStateProperty<
TextStyle?> ? textStyle, - WidgetStateProperty<
Color?> ? backgroundColor, - WidgetStateProperty<
Color?> ? foregroundColor, - WidgetStateProperty<
Color?> ? overlayColor, - WidgetStateProperty<
Color?> ? shadowColor, - WidgetStateProperty<
Color?> ? surfaceTintColor, - WidgetStateProperty<
double?> ? elevation, - WidgetStateProperty<
EdgeInsetsGeometry?> ? padding, - WidgetStateProperty<
Size?> ? minimumSize, - WidgetStateProperty<
Size?> ? fixedSize, - WidgetStateProperty<
Size?> ? maximumSize, - WidgetStateProperty<
Color?> ? iconColor, - WidgetStateProperty<
double?> ? iconSize, - IconAlignment? iconAlignment,
- WidgetStateProperty<
BorderSide?> ? side, - WidgetStateProperty<
OutlinedBorder?> ? shape, - WidgetStateProperty<
MouseCursor?> ? mouseCursor, - VisualDensity? visualDensity,
- MaterialTapTargetSize? tapTargetSize,
- Duration? animationDuration,
- bool? enableFeedback,
- AlignmentGeometry? alignment,
- InteractiveInkFeatureFactory? splashFactory,
- ButtonLayerBuilder? backgroundBuilder,
- ButtonLayerBuilder? foregroundBuilder,
Returns a copy of this ButtonStyle with the given fields replaced with the new values.
Implementation
ButtonStyle copyWith({
WidgetStateProperty<TextStyle?>? textStyle,
WidgetStateProperty<Color?>? backgroundColor,
WidgetStateProperty<Color?>? foregroundColor,
WidgetStateProperty<Color?>? overlayColor,
WidgetStateProperty<Color?>? shadowColor,
WidgetStateProperty<Color?>? surfaceTintColor,
WidgetStateProperty<double?>? elevation,
WidgetStateProperty<EdgeInsetsGeometry?>? padding,
WidgetStateProperty<Size?>? minimumSize,
WidgetStateProperty<Size?>? fixedSize,
WidgetStateProperty<Size?>? maximumSize,
WidgetStateProperty<Color?>? iconColor,
WidgetStateProperty<double?>? iconSize,
IconAlignment? iconAlignment,
WidgetStateProperty<BorderSide?>? side,
WidgetStateProperty<OutlinedBorder?>? shape,
WidgetStateProperty<MouseCursor?>? mouseCursor,
VisualDensity? visualDensity,
MaterialTapTargetSize? tapTargetSize,
Duration? animationDuration,
bool? enableFeedback,
AlignmentGeometry? alignment,
InteractiveInkFeatureFactory? splashFactory,
ButtonLayerBuilder? backgroundBuilder,
ButtonLayerBuilder? foregroundBuilder,
}) {
return ButtonStyle(
textStyle: textStyle ?? this.textStyle,
backgroundColor: backgroundColor ?? this.backgroundColor,
foregroundColor: foregroundColor ?? this.foregroundColor,
overlayColor: overlayColor ?? this.overlayColor,
shadowColor: shadowColor ?? this.shadowColor,
surfaceTintColor: surfaceTintColor ?? this.surfaceTintColor,
elevation: elevation ?? this.elevation,
padding: padding ?? this.padding,
minimumSize: minimumSize ?? this.minimumSize,
fixedSize: fixedSize ?? this.fixedSize,
maximumSize: maximumSize ?? this.maximumSize,
iconColor: iconColor ?? this.iconColor,
iconSize: iconSize ?? this.iconSize,
iconAlignment: iconAlignment ?? this.iconAlignment,
side: side ?? this.side,
shape: shape ?? this.shape,
mouseCursor: mouseCursor ?? this.mouseCursor,
visualDensity: visualDensity ?? this.visualDensity,
tapTargetSize: tapTargetSize ?? this.tapTargetSize,
animationDuration: animationDuration ?? this.animationDuration,
enableFeedback: enableFeedback ?? this.enableFeedback,
alignment: alignment ?? this.alignment,
splashFactory: splashFactory ?? this.splashFactory,
backgroundBuilder: backgroundBuilder ?? this.backgroundBuilder,
foregroundBuilder: foregroundBuilder ?? this.foregroundBuilder,
);
}