copyWith method

ConnectionTheme copyWith({
  1. ConnectionStyle? style,
  2. Color? color,
  3. Color? selectedColor,
  4. double? strokeWidth,
  5. double? selectedStrokeWidth,
  6. List<double>? dashPattern,
  7. ConnectionEndPoint? startPoint,
  8. ConnectionEndPoint? endPoint,
  9. ConnectionEffect? animationEffect,
  10. double? bezierCurvature,
  11. double? cornerRadius,
  12. double? portExtension,
  13. double? hitTolerance,
})

Creates a copy of this theme with optionally updated properties.

Any parameter that is not provided will retain its current value.

Note: Passing null for dashPattern or animationEffect will set them to null.

Implementation

ConnectionTheme copyWith({
  ConnectionStyle? style,
  Color? color,
  Color? selectedColor,
  double? strokeWidth,
  double? selectedStrokeWidth,
  List<double>? dashPattern,
  ConnectionEndPoint? startPoint,
  ConnectionEndPoint? endPoint,
  ConnectionEffect? animationEffect,
  double? bezierCurvature,
  double? cornerRadius,
  double? portExtension,
  double? hitTolerance,
}) {
  return ConnectionTheme(
    style: style ?? this.style,
    color: color ?? this.color,
    selectedColor: selectedColor ?? this.selectedColor,
    strokeWidth: strokeWidth ?? this.strokeWidth,
    selectedStrokeWidth: selectedStrokeWidth ?? this.selectedStrokeWidth,
    dashPattern: dashPattern,
    startPoint: startPoint ?? this.startPoint,
    endPoint: endPoint ?? this.endPoint,
    animationEffect: animationEffect,
    bezierCurvature: bezierCurvature ?? this.bezierCurvature,
    cornerRadius: cornerRadius ?? this.cornerRadius,
    portExtension: portExtension ?? this.portExtension,
    hitTolerance: hitTolerance ?? this.hitTolerance,
  );
}