withChange method

  1. @override
TipStyle withChange({
  1. Color? fillColor,
  2. Color? strokeColor,
  3. double? strokeWidth,
  4. Color? backgroundStrokeColor,
  5. double? backgroundStrokeWidth,
  6. List<Color>? fillColors,
  7. List<Color>? strokeColors,
  8. List<Color>? backgroundStrokeColors,
})
override

Implementation

@override
TipStyle withChange({
  Color? fillColor,
  Color? strokeColor,
  double? strokeWidth,
  Color? backgroundStrokeColor,
  double? backgroundStrokeWidth,

  // The following arguments aren't actually used
  List<Color>? fillColors,
  List<Color>? strokeColors,
  List<Color>? backgroundStrokeColors,
}) {
  var _fillColor = fillColor ?? fillColors?.first ?? TRANSPARENT;
  var _strokeColor = strokeColor ?? strokeColors?.first ?? TRANSPARENT;
  var _strokeWidth = strokeWidth ?? this.strokeWidth;
  var _backgroundStrokeColor =
      backgroundStrokeColor ?? backgroundStrokeColors?.first ?? TRANSPARENT;
  var _backgroundStrokeWidth =
      backgroundStrokeWidth ?? this.backgroundStrokeWidth;

  return TipStyle(
    fillColor: _fillColor,
    strokeColor: _strokeColor,
    strokeWidth: _strokeWidth,
    backgroundStrokeColor: _backgroundStrokeColor,
    backgroundStrokeWidth: _backgroundStrokeWidth,
  );
}