copyWith method

GlassStyle copyWith({
  1. double? rim,
  2. double? curve,
  3. double? depth,
  4. double? dispersion,
  5. double? blur,
  6. double? saturation,
  7. Color? tint,
  8. double? specular,
  9. Offset? light,
  10. double? edgeDark,
  11. double? shadow,
  12. double? shadowBlur,
  13. Offset? shadowOffset,
})

Implementation

GlassStyle copyWith({
  double? rim,
  double? curve,
  double? depth,
  double? dispersion,
  double? blur,
  double? saturation,
  Color? tint,
  double? specular,
  Offset? light,
  double? edgeDark,
  double? shadow,
  double? shadowBlur,
  Offset? shadowOffset,
}) {
  final r = rim ?? this.rim;
  final c = curve ?? this.curve;
  final dp = depth ?? this.depth;
  final d = dispersion ?? this.dispersion;
  final b = blur ?? this.blur;
  final sat = saturation ?? this.saturation;
  final t = tint ?? this.tint;
  final s = specular ?? this.specular;
  final l = light ?? this.light;
  final ed = edgeDark ?? this.edgeDark;
  final sh = shadow ?? this.shadow;
  final sb = shadowBlur ?? this.shadowBlur;
  final so = shadowOffset ?? this.shadowOffset;

  if (r == this.rim &&
      c == this.curve &&
      dp == this.depth &&
      d == this.dispersion &&
      b == this.blur &&
      sat == this.saturation &&
      t == this.tint &&
      s == this.specular &&
      l == this.light &&
      ed == this.edgeDark &&
      sh == this.shadow &&
      sb == this.shadowBlur &&
      so == this.shadowOffset) {
    return this;
  }

  return GlassStyle(
    rim: r,
    curve: c,
    depth: dp,
    dispersion: d,
    blur: b,
    saturation: sat,
    tint: t,
    specular: s,
    light: l,
    edgeDark: ed,
    shadow: sh,
    shadowBlur: sb,
    shadowOffset: so,
  );
}