axisYLabels method

Widget axisYLabels(
  1. double gh,
  2. double gw,
  3. BuildContext context,
  4. List<Point> points,
)

Implementation

Widget axisYLabels(double gh, double gw, BuildContext context, List<Point> points) {
  return Padding(
    padding: const EdgeInsets.only(left: 0),
    child: SizedBox(
      height: gh,
      width: gw,
      child: ListView.builder(
          physics: const NeverScrollableScrollPhysics(),
          shrinkWrap: true,
          scrollDirection: Axis.vertical,
          itemCount: points.length,
          itemBuilder: (_, i) {
            return Column(
              children: [
                SizedBox(
                  height: gh * 0.05,
                  child: Text(
                    points.reversed.toList()[i].y.toString(),
                    style: const TextStyle(
                      color: Colors.black,
                      fontSize: 10,
                    ),
                  ),
                ),
                if (i == points.length - 1)
                  Container()
                else
                  SizedBox(
                    height: gh * 0.7 / (points.length - 1) - gh * 0.05,
                  )
              ],
            );
          }),
    ),
  );
}