copyWith method
- 👆
operator >(VoidCallback onTap)
➡ IconButton 📋 Return an IconToo with fields that mirrorthis
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
.
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,
);