copyWith method

PainterControllerValue copyWith({
  1. PainterSettings? settings,
  2. List<Drawable>? drawables,
  3. BackgroundDrawable? background = _NoBackgroundPassedBackgroundDrawable.instance,
  4. ObjectDrawable? selectedObjectDrawable = _NoObjectPassedBackgroundDrawable.instance,
})

Creates a copy of this value but with the given fields replaced with the new values.

Implementation

PainterControllerValue copyWith({
  PainterSettings? settings,
  List<Drawable>? drawables,
  BackgroundDrawable? background =
      _NoBackgroundPassedBackgroundDrawable.instance,
  ObjectDrawable? selectedObjectDrawable =
      _NoObjectPassedBackgroundDrawable.instance,
}) {
  return PainterControllerValue(
    settings: settings ?? this.settings,
    drawables: drawables ?? _drawables,
    background: background == _NoBackgroundPassedBackgroundDrawable.instance
        ? this.background
        : background,
    selectedObjectDrawable:
        selectedObjectDrawable == _NoObjectPassedBackgroundDrawable.instance
            ? this.selectedObjectDrawable
            : selectedObjectDrawable,
  );
}