isStreakActive method

Future<bool> isStreakActive(
  1. String userEmail
)

Checks if the user currently has an active streak.

Implementation

Future<bool> isStreakActive(String userEmail) async {
  final userRef = await _getUserDocRef(userEmail);
  final streaks = await userRef
      .collection('streaks')
      .where('isActive', isEqualTo: true)
      .limit(1)
      .get();

  return streaks.docs.isNotEmpty;
}