drawStars method

void drawStars(
  1. Canvas canvas
)

Draws the Star objects on the provided Canvas.

Based on the stars index value, either a smaller or a larger start will be painted to create variety.

Implementation

void drawStars(Canvas canvas) {
  for (int i = 0; i < controller.stars.length - 1; i++) {
    if (i < controller.stars.length ~/ 15) {
      drawLargeSizedStar(
        canvas,
        controller.stars[i],
        starPaint,
      );
    } else {
      drawSmallSizedStar(
        canvas,
        controller.stars[i],
        starPaint,
      );
    }
  }
}