copyWithToggle method

Neu copyWithToggle({
  1. Color? color,
  2. int? depth,
  3. double? spread,
  4. Alignment? lightSource,
  5. bool? isToggled,
  6. bool? isFlat,
  7. bool? isSuper,
  8. double? depthMultiplier,
  9. double? spreadMultiplier,
  10. NeuTextSpec? neuTextSpec,
  11. BorderRadius? borderRadius,
  12. ShapeBorder? shape,
})

📋 Create a new Neu.toggle object that has the same properties as this one except for any optional parameters passed through this copyWithToggle method.

Implementation

Neu copyWithToggle({
  Color? color,
  int? depth,
  double? spread,
  Alignment? lightSource,
  bool? isToggled,
  bool? isFlat,
  bool? isSuper,
  double? depthMultiplier,
  double? spreadMultiplier,
  NeuTextSpec? neuTextSpec,
  BorderRadius? borderRadius,
  ShapeBorder? shape,
}) {
  return Neu.toggle(
    color: color ?? this.color,
    depth: depth ?? this.depth,
    spread: spread ?? this.spread,
    lightSource: lightSource ?? this.lightSource,
    isToggled: isToggled ?? _isToggled ?? false,
    isFlat: isFlat ?? _isFlat ?? false,
    isSuper: isSuper ?? _isSuper ?? false,
    depthMultiplier:
        depthMultiplier ?? _depthMultiplier ?? defaultDepthMultiplier,
    spreadMultiplier:
        spreadMultiplier ?? _spreadMultiplier ?? defaultSpreadMultiplier,
    neuTextSpec: neuTextSpec ?? this.neuTextSpec,
    borderRadius: borderRadius ?? this.borderRadius,
    shape: shape ?? this.shape,
  );
}