merge method

Returns a copy of this AuthButtonStyle where the non-null fields in style have replaced the corresponding null fields in this AuthButtonStyle.

In other words, style is used to fill in unspecified (null) fields this AuthButtonStyle.

unlike copyWith() where replaces the given fields with new values, this method will assign the given values only if values is null.

Implementation

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