getHeight method

  1. @override
double getHeight(
  1. int index,
  2. int count,
  3. double width,
  4. double height,
  5. double fontHeight,
  6. double textPadding,
  7. bool drawText,
)
override

Get the bar height for a specific index

Implementation

@override
double getHeight(
  int index,
  int count,
  double width,
  double height,
  double fontHeight,
  double textPadding,
  bool drawText,
) {
  if (!drawText) {
    return super.getHeight(
      index,
      count,
      width,
      height,
      fontHeight,
      textPadding,
      drawText,
    );
  }

  final h = height - fontHeight - textPadding;

  if (index + count < 4 || (index > 31 && index + count < 36) || index > 63) {
    return h + fontHeight / 2 + textPadding;
  }

  return h;
}