copyWith method

IconButton copyWith({
  1. double? iconSize,
  2. VisualDensity? visualDensity,
  3. EdgeInsetsGeometry? padding,
  4. AlignmentGeometry? alignment,
  5. double? splashRadius,
  6. Color? color,
  7. Color? focusColor,
  8. Color? hoverColor,
  9. Color? highlightColor,
  10. Color? splashColor,
  11. Color? disabledColor,
  12. void onPressed()?,
  13. MouseCursor? mouseCursor,
  14. FocusNode? focusNode,
  15. bool? autofocus,
  16. String? tooltip,
  17. bool? enableFeedback,
  18. BoxConstraints? constraints,
  19. Widget? icon,
})

Creates a copy of IconButton with specified attributes overridden.

Implementation

IconButton copyWith({
  double? iconSize,
  VisualDensity? visualDensity,
  EdgeInsetsGeometry? padding,
  AlignmentGeometry? alignment,
  double? splashRadius,
  Color? color,
  Color? focusColor,
  Color? hoverColor,
  Color? highlightColor,
  Color? splashColor,
  Color? disabledColor,
  void Function()? onPressed,
  MouseCursor? mouseCursor,
  FocusNode? focusNode,
  bool? autofocus,
  String? tooltip,
  bool? enableFeedback,
  BoxConstraints? constraints,
  Widget? icon,
}) =>
    IconButton(
      iconSize: iconSize ?? this.iconSize,
      visualDensity: visualDensity ?? this.visualDensity,
      padding: padding ?? this.padding,
      alignment: alignment ?? this.alignment,
      splashRadius: splashRadius ?? this.splashRadius,
      color: color ?? this.color,
      focusColor: focusColor ?? this.focusColor,
      hoverColor: hoverColor ?? this.hoverColor,
      highlightColor: highlightColor ?? this.highlightColor,
      splashColor: splashColor ?? this.splashColor,
      disabledColor: disabledColor ?? this.disabledColor,
      onPressed: onPressed ?? this.onPressed,
      mouseCursor: mouseCursor ?? this.mouseCursor,
      focusNode: focusNode ?? this.focusNode,
      autofocus: autofocus ?? this.autofocus,
      tooltip: tooltip ?? this.tooltip,
      enableFeedback: enableFeedback ?? this.enableFeedback,
      constraints: constraints ?? this.constraints,
      icon: icon ?? this.icon,
    );