replace method Null safety

AuthButtonStyle replace(
  1. AuthButtonStyle? style
)

Returns a copy of this AuthButtonStyle with the given style replaced with the new values.

Like copyWith() it replaces fields with new values, but it allows you passing AuthButtonStyle instead of passing every single field.

Implementation

AuthButtonStyle replace(AuthButtonStyle? style) {
  if (style == null) return this;
  return copyWith(
    buttonColor: style.buttonColor,
    splashColor: style.splashColor,
    elevation: style.elevation,
    borderRadius: style.borderRadius,
    padding: style.padding,
    margin: style.margin,
    textStyle: style.textStyle,
    borderColor: style.borderColor,
    borderWidth: style.borderWidth,
    buttonType: style.buttonType,
    width: style.width,
    height: style.height,
    iconSize: style.iconSize,
    separator: style.separator,
    iconBackground: style.iconBackground,
    iconType: style.iconType,
    shadowColor: style.shadowColor,
    progressIndicatorColor: style.progressIndicatorColor,
    progressIndicatorValueColor: style.progressIndicatorValueColor,
    progressIndicatorStrokeWidth: style.progressIndicatorStrokeWidth,
    progressIndicatorValue: style.progressIndicatorValue,
    iconColor: style.iconColor,
    progressIndicatorType: style.progressIndicatorType,
    visualDensity: style.visualDensity,
    tapTargetSize: style.tapTargetSize,
  );
}