graphic icon indicating copy to clipboard operation
graphic copied to clipboard

Migration from 1.0.1 to latest

Open BiagioDecataldo opened this issue 5 months ago • 2 comments

I have upgraded from version 1.0.1 to the latest version (2.6.0) but I have several errors and I couldn't find a migration guide. Is there a guide on how to update everything?

BiagioDecataldo avatar Jul 31 '25 13:07 BiagioDecataldo

It's a big span from 1.0.1 to 2.6.0, there is no special guide doc. You can rise issues if you got unsolved errors

entronad avatar Aug 05 '25 07:08 entronad

I can't figure out how to replace MarkAnnotation, any suggestions?

example:

List<Annotation> getAnnotations() {
    return [
      MarkAnnotation(
        relativePath: Paths.sector(
          center: Offset.zero,
          r: (diameter / 2) * 0.85,
          r0: diameter / 2,
          startAngle: 0,
          endAngle: 2 * pi,
          clockwise: true,
        ),
        layer: -2,
        style: getBackgroundPaint(diameter, type),
        anchor: (size) => Offset((size.height) / 2, (size.height) / 2),
      ),
      MarkAnnotation(
        relativePath: Paths.sector(
          center: Offset.zero,
          r: 0,
          r0: diameter / 2 * 0.7,
          startAngle: 0,
          endAngle: 2 * pi,
          clockwise: true,
        ),
        layer: -2,
        style: getBackgroundCentralCirclePaint(diameter, type),
        anchor: (size) => Offset((size.height) / 2, (size.height) / 2),
      ),
      if (getDelta() < 0 && type != FullGaugeType.notConnected && getDelta() < 0 && type != FullGaugeType.notShift)
        MarkAnnotation(
          relativePath: Paths.sector(
            center: Offset.zero,
            r: (diameter / 2) * 0.85,
            r0: diameter / 2,
            startAngle: ((data / 100) * 2 * pi) + ((-1 / 2) * pi),
            endAngle: ((limit / 100) * 2 * pi) + ((-1 / 2) * pi),
            clockwise: true,
          ),
          layer: 0,
          style: getNegativeDeltaBackgroundPaint(diameter, type),
          anchor: (size) => Offset((size.height) / 2, (size.height) / 2),
        ),
      if (getDelta() > 0 && type != FullGaugeType.notConnected && getDelta() > 0 && type != FullGaugeType.notShift)
        MarkAnnotation(
          relativePath: Paths.sector(
            center: Offset.zero,
            r: (diameter / 2) * 0.85,
            r0: diameter / 2,
            startAngle: data <= 100
                ? ((limit / 100) * 2 * pi) + ((-1 / 2) * pi)
                : ((-1 / 2) * pi),
            endAngle: ((data / 100) * 2 * pi) + ((-1 / 2) * pi),
            clockwise: true,
          ),
          layer: 0,
          style: getPositiveDeltaBackgroundPaint(
            diameter,
            data <= 100 ? ((limit / 100) * 2 * pi) : 0,
            (data / 100) * 2 * pi,
            type,
          ),
          anchor: (size) => Offset((size.height) / 2, (size.height) / 2),
        ),
      if (type != FullGaugeType.notConnected && type != FullGaugeType.notShift)
        CustomAnnotation(
          renderer: getCentralLabel,
          anchor: (_) => Offset.zero,
        ),
    ];
  }``

@entronad

BiagioDecataldo avatar Oct 22 '25 13:10 BiagioDecataldo