Skip to content

Migration issues #99

@Webierta

Description

@Webierta

Hello, can you help me migrate this code to the new version.

  1. This way I could only see the current time bubble:
itemOptions: BubbleItemOptions(
    colorForValue: (_, value, [min]) {
        horaValor++;
        if (horaValor > 23) {
            horaValor = 0;
        }
        if (value != null) {                  
            if (hora == horaValor) {
                return Colors.white;
            }
        }
        return Colors.transparent;
    },
),

This doesn't work because it draws the bubble at the bottom:

itemOptions: BubbleItemOptions(
    maxBarWidth: 4,
    bubbleItemBuilder: (data) {
        if (data.itemIndex == hora) {
            return const BubbleItem(color: Colors.white);
        }
        return const BubbleItem(color: Colors.transparent);
    },
),
  1. This is how I managed to draw the middle line of the data:
backgroundDecorations: [
    TargetLineDecoration(
        target: dataHoy.calcularPrecioMedio(dataHoy.preciosHora),
        targetLineColor: Colors.blue,
        lineWidth: 1,
    ),
],

Thank you

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions