isCardFrontVisible function

bool isCardFrontVisible(
  1. double angle
)

Returns true when the front face of a 3D flip card is oriented toward the camera.

Implementation

bool isCardFrontVisible(double angle) {
  // cos(angle) > 0 means the normal points toward camera.
  final normalized = angle % (2 * math.pi);
  return normalized < math.pi / 2 || normalized > 3 * math.pi / 2;
}