copyWith method

Icon copyWith({
  1. double? size,
  2. Color? color,
  3. String? semanticLabel,
  4. TextDirection? textDirection,
})

Extension method to directly access Icon's props without wrapping or with dot operator.

Implementation

Icon copyWith({
  double? size,
  Color? color,
  String? semanticLabel,
  TextDirection? textDirection,
}) =>
    Icon(
      icon,
      color: color ?? this.color,
      size: size ?? this.size,
      semanticLabel: semanticLabel ?? this.semanticLabel,
      textDirection: textDirection ?? this.textDirection,
    );