copyWith method Null safety
- {MaterialStateProperty<
TextStyle?> ? textStyle, - MaterialStateProperty<
Color?> ? backgroundColor, - MaterialStateProperty<
Color?> ? foregroundColor, - MaterialStateProperty<
Color?> ? overlayColor, - MaterialStateProperty<
Color?> ? shadowColor, - MaterialStateProperty<
Color?> ? surfaceTintColor, - MaterialStateProperty<
double?> ? elevation, - MaterialStateProperty<
EdgeInsetsGeometry?> ? padding, - MaterialStateProperty<
Size?> ? minimumSize, - MaterialStateProperty<
Size?> ? fixedSize, - MaterialStateProperty<
Size?> ? maximumSize, - MaterialStateProperty<
double?> ? iconSize, - MaterialStateProperty<
BorderSide?> ? side, - MaterialStateProperty<
OutlinedBorder?> ? shape, - MaterialStateProperty<
MouseCursor?> ? mouseCursor, - VisualDensity? visualDensity,
- MaterialTapTargetSize? tapTargetSize,
- Duration? animationDuration,
- bool? enableFeedback,
- AlignmentGeometry? alignment,
- InteractiveInkFeatureFactory? splashFactory}
Returns a copy of this ButtonStyle with the given fields replaced with the new values.
Implementation
ButtonStyle copyWith({
MaterialStateProperty<TextStyle?>? textStyle,
MaterialStateProperty<Color?>? backgroundColor,
MaterialStateProperty<Color?>? foregroundColor,
MaterialStateProperty<Color?>? overlayColor,
MaterialStateProperty<Color?>? shadowColor,
MaterialStateProperty<Color?>? surfaceTintColor,
MaterialStateProperty<double?>? elevation,
MaterialStateProperty<EdgeInsetsGeometry?>? padding,
MaterialStateProperty<Size?>? minimumSize,
MaterialStateProperty<Size?>? fixedSize,
MaterialStateProperty<Size?>? maximumSize,
MaterialStateProperty<double?>? iconSize,
MaterialStateProperty<BorderSide?>? side,
MaterialStateProperty<OutlinedBorder?>? shape,
MaterialStateProperty<MouseCursor?>? mouseCursor,
VisualDensity? visualDensity,
MaterialTapTargetSize? tapTargetSize,
Duration? animationDuration,
bool? enableFeedback,
AlignmentGeometry? alignment,
InteractiveInkFeatureFactory? splashFactory,
}) {
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,
iconSize: iconSize ?? this.iconSize,
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,
);
}