Skip to content

Commit

Permalink
feat: added card number indicator
Browse files Browse the repository at this point in the history
  • Loading branch information
SethCohen committed Feb 16, 2023
1 parent 27a966d commit 16e5c93
Showing 1 changed file with 23 additions and 13 deletions.
36 changes: 23 additions & 13 deletions src/lib/widgets/lesson.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,29 @@ class _LessonState extends State<Lesson> {
final cards = snapshot.data!.docs;
_cardsLength = cards.length;

// TODO display total amount of cards left to review
// TODO display progress bar

return IndexedStack(
index: _currentCardIndex,
children: cards.map((card) {
return Flashcard(
data: card,
handleCard: _updateCardInProgressCollection,
handleCardIndex: _incrementCardIndex,
isReview: isReview,
);
}).toList(),
return Column(
children: [
const SizedBox(height: 20),
Text(
'Card ${_currentCardIndex + 1} of $_cardsLength',
style: const TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
),
const SizedBox(height: 20),
IndexedStack(
index: _currentCardIndex,
children: cards.map((card) {
return Flashcard(
data: card,
handleCard: _updateCardInProgressCollection,
handleCardIndex: _incrementCardIndex,
isReview: isReview,
);
}).toList()),
// TODO display progress bar
],
);
} else if (snapshot.hasError) {
return const Center(child: Text('Something went wrong!'));
Expand Down

0 comments on commit 16e5c93

Please sign in to comment.