'combine ticks if they're within 2 digits of eachother - flutter charts

If the ticks in my chart are too close to eachother or the same exact value then the ticks overlap, even with a rotated label. I'm wondering what code I can implement in the following code to combine the ticks, in the case that they're too close to eacother (within 2 digits). This is how it looks currently.

enter image description here

        tickProviderSpec: charts.StaticNumericTickProviderSpec([
            if (currentOptimal != 0)
              charts.TickSpec(currentOptimal,
                  label: currentOptimal.toString() + ' Optimal'),
            if (currentEnrouteOptimal != 0)
              charts.TickSpec(currentEnrouteOptimal,
                  label: currentEnrouteOptimal.toString() + ' Enroute Optimal'),
            if (currentFlexMax != 0)
              charts.TickSpec(currentFlexMax,
                  label: currentFlexMax.toString() + ' Flex Max'),
          ]),


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source