copyWith method

Icon copyWith({
  1. Key? key,
  2. IconData? icon,
  3. double? size,
  4. Color? color,
  5. String? semanticLabel,
  6. TextDirection? textDirection,
})

📋 Return an Icon with fields that mirror this except for the parameters given with this method.

Implementation

Icon copyWith({
  Key? key,
  IconData? icon,
  double? size,
  Color? color,
  String? semanticLabel,
  TextDirection? textDirection,
}) =>
    Icon(
      icon ?? this.icon,
      key: key ?? this.key, // should ignore this.key?
      size: size ?? this.size,
      color: color ?? this.color,
      semanticLabel: semanticLabel ?? this.semanticLabel,
      textDirection: textDirection ?? this.textDirection,
    );