copyWith method

IconToo copyWith({
  1. Key? key,
  2. IconData? icon,
  3. Size? trueSize,
  4. double? sizeX,
  5. double? sizeY,
  6. Color? color,
  7. List<Shadow>? shadows,
  8. AlignmentGeometry? alignment,
  9. String? semanticLabel,
  10. TextDirection? textDirection,
})
  • 👆 operator >(VoidCallback onTap)IconButton 📋 Return an IconToo with fields that mirror this except for the parameters given with this method.

Follows same pattern as IconToo in that a Size provided trueSize will override nums sizeX and sizeY.

Implementation

// - ➕ `operator +(inflate)` ➡ `sizeX += inflation` & `sizeY += inflation`
// - ➖ `operator -(deflate)` ➡ `sizeX -= deflation` & `sizeY -= deflation`
// - ❌ `operator *(dynamic operation)`
//   - ❓ `operation is Color` ➡ `color = operation`
//   - ❓ `operation is num` ➡ `sizeX *= operation` & `sizeY *= operation`
//   - ❓ `operation is List<num>` ➡ `sizeX *= operation[0]` & `sizeY *= operation[1]`
// - 💥 `operator %(dynamic modulation)`
//   - ❓ `modulation is List<Color>` ➡ `color = modulation[Random()]`
//   - ❓ `modulation is List<num>` ➡ `sizeX *= modulation[random]` & `sizeY *= modulation[random]`
// - 🧦 `operator &(dynamic padding)`
//   - ❓ `padding is num` ➡ `EdgeInsets.all(padding)`
//   - ❓ `padding is List<num>` (length==2) ➡ `EdgeInsets.symmetric(horizontal: padding[0], vertical: padding[1])`
//   - ❓ `padding is List<num>` (length==4) ➡ `EdgeInsets.fromLTRB(padding[0], padding[1],padding[2], padding[3])`
// ____________________________

/// 📋 Return an [IconToo] with fields that mirror `this`
/// except for the parameters given with this method.
///
/// Follows same pattern as [IconToo] in that a [Size] provided
/// [trueSize] will override `num`s [sizeX] and [sizeY].
IconToo copyWith({
  Key? key,
  IconData? icon,
  Size? trueSize,
  double? sizeX,
  double? sizeY,
  Color? color,
  List<Shadow>? shadows,
  AlignmentGeometry? alignment,
  String? semanticLabel,
  TextDirection? textDirection,
}) =>
    IconToo(
      icon ?? this.icon,
      key: key ?? this.key, // should ignore this.key?
      sizeX: trueSize?.width ?? sizeX ?? this.sizeX,
      sizeY: trueSize?.height ?? sizeY ?? this.sizeY,
      color: color ?? this.color,
      shadows: shadows ?? this.shadows,
      alignment: alignment ?? this.alignment,
      semanticLabel: semanticLabel ?? this.semanticLabel,
      textDirection: textDirection ?? this.textDirection,
    );