initBackgroundLines method

void initBackgroundLines()

Implementation

void initBackgroundLines() {
  fadedLineStyle ??= VMobjectStyle(
    backgroundStrokeColors: backgroundLineStyle.backgroundStrokeColors,
    backgroundStrokeWidth: backgroundLineStyle.backgroundStrokeWidth * 0.5,
    fillColors: [],
    strokeColors: [
      for (var color in backgroundLineStyle.strokeColors ?? <Color>[])
        color.withTransparency(color.a * 0.5)
    ],
    strokeWidth: backgroundLineStyle.strokeWidth * 0.5,
  );

  var allLines = getLines();
  backgroundLines = allLines[0];
  fadedLines = allLines[1];

  var backgroundGroup = VGroup(backgroundLines)
    ..setStyleFromVMobjectStyle(backgroundLineStyle);
  var fadedGroup = VGroup(fadedLines)
    ..setStyleFromVMobjectStyle(fadedLineStyle!);

  addToBack([
    backgroundGroup,
    fadedGroup,
  ]);
}