mergeAndBlend static method

DrawableStyle mergeAndBlend(
  1. DrawableStyle? parent, {
  2. DrawablePaint? fill,
  3. DrawablePaint? stroke,
  4. CircularIntervalList<double>? dashArray,
  5. DashOffset? dashOffset,
  6. DrawableTextStyle? textStyle,
  7. PathFillType? pathFillType,
  8. double? groupOpacity,
  9. List<Path>? clipPath,
  10. DrawableStyleable? mask,
  11. BlendMode? blendMode,
})

Creates a new DrawableStyle if parent is not null, filling in any null properties on this with the properties from other (except groupOpacity, is not inherited).

Implementation

static DrawableStyle mergeAndBlend(
  DrawableStyle? parent, {
  DrawablePaint? fill,
  DrawablePaint? stroke,
  CircularIntervalList<double>? dashArray,
  DashOffset? dashOffset,
  DrawableTextStyle? textStyle,
  PathFillType? pathFillType,
  double? groupOpacity,
  List<Path>? clipPath,
  DrawableStyleable? mask,
  BlendMode? blendMode,
}) {
  return DrawableStyle(
    fill: DrawablePaint.merge(fill, parent?.fill),
    stroke: DrawablePaint.merge(stroke, parent?.stroke),
    dashArray: dashArray ?? parent?.dashArray,
    dashOffset: dashOffset ?? parent?.dashOffset,
    textStyle: DrawableTextStyle.merge(textStyle, parent?.textStyle),
    pathFillType: pathFillType ?? parent?.pathFillType,
    groupOpacity: groupOpacity,
    // clips don't make sense to inherit - applied to canvas with save/restore
    // that wraps any potential children
    clipPath: clipPath,
    mask: mask,
    blendMode: blendMode,
  );
}