getDueCardCount method

Future<int> getDueCardCount()

Lightweight count of due review cards (avoids fetching full objects).

Implementation

Future<int> getDueCardCount() async {
  final userId = _client.auth.currentUser?.id;
  if (userId == null) return 0;

  final now = DateTime.now().toIso8601String();
  final response = await _client
      .from('review_cards')
      .select('id')
      .eq('user_id', userId)
      .lte('next_review_at', now);
  return (response as List<dynamic>).length;
}