copyWith method

Implementation

AbstractButtonStyle copyWith({
  ButtonStatePropertyDelegate<Decoration>? decoration,
  ButtonStatePropertyDelegate<MouseCursor>? mouseCursor,
  ButtonStatePropertyDelegate<EdgeInsetsGeometry>? padding,
  ButtonStatePropertyDelegate<TextStyle>? textStyle,
  ButtonStatePropertyDelegate<IconThemeData>? iconTheme,
  ButtonStatePropertyDelegate<EdgeInsetsGeometry>? margin,
}) {
  if (decoration == null &&
      mouseCursor == null &&
      padding == null &&
      textStyle == null &&
      iconTheme == null &&
      margin == null) {
    return this;
  }
  if (this is _CopyWithButtonStyle) {
    var copy = this as _CopyWithButtonStyle;
    return _CopyWithButtonStyle(
      copy._delegate,
      decoration ?? copy._decoration,
      mouseCursor ?? copy._mouseCursor,
      padding ?? copy._padding,
      textStyle ?? copy._textStyle,
      iconTheme ?? copy._iconTheme,
      margin ?? copy._margin,
    );
  }
  return _CopyWithButtonStyle(
    this,
    decoration,
    mouseCursor,
    padding,
    textStyle,
    iconTheme,
    margin,
  );
}