complete feedback added

This commit is contained in:
gitea
2026-01-03 19:56:40 +01:00
parent 51e88a4aaf
commit 2ea573642d
3 changed files with 152 additions and 59 deletions
+56
View File
@@ -99,6 +99,42 @@ class _AttemptResultScreenState extends State<AttemptResultScreen> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
// 100% Completion Celebration
if (_deck != null && _deck!.knownCount == _deck!.numberOfQuestions && _deck!.numberOfQuestions > 0) ...[
Card(
color: Theme.of(context).colorScheme.primaryContainer,
child: Padding(
padding: const EdgeInsets.all(24),
child: Column(
children: [
Icon(
Icons.celebration,
size: 64,
color: Theme.of(context).colorScheme.onPrimaryContainer,
),
const SizedBox(height: 16),
Text(
'Deck Completed!',
style: Theme.of(context).textTheme.headlineMedium?.copyWith(
fontWeight: FontWeight.bold,
color: Theme.of(context).colorScheme.onPrimaryContainer,
),
),
const SizedBox(height: 8),
Text(
'Congratulations! You\'ve mastered all ${_deck!.numberOfQuestions} questions in this deck!',
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.bodyLarge?.copyWith(
color: Theme.of(context).colorScheme.onPrimaryContainer.withValues(alpha: 0.9),
),
),
],
),
),
),
const SizedBox(height: 24),
],
// Summary Card
Card(
child: Padding(
@@ -126,6 +162,26 @@ class _AttemptResultScreenState extends State<AttemptResultScreen> {
'${_result!.correctCount} of ${_result!.totalQuestions} correct',
style: Theme.of(context).textTheme.titleMedium,
),
// Show deck progress if available
if (_deck != null && _deck!.numberOfQuestions > 0) ...[
const SizedBox(height: 16),
Divider(),
const SizedBox(height: 16),
Text(
'Deck Progress',
style: Theme.of(context).textTheme.titleSmall,
),
const SizedBox(height: 8),
Text(
'${_deck!.knownCount} of ${_deck!.numberOfQuestions} questions known',
style: Theme.of(context).textTheme.titleMedium?.copyWith(
fontWeight: FontWeight.bold,
color: _deck!.knownCount == _deck!.numberOfQuestions
? Colors.green
: null,
),
),
],
const SizedBox(height: 24),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
+41 -4
View File
@@ -353,8 +353,10 @@ class _DeckListScreenState extends State<DeckListScreen> {
itemCount: _decks.length,
itemBuilder: (context, index) {
final deck = _decks[index];
final isCompleted = deck.knownCount == deck.numberOfQuestions && deck.numberOfQuestions > 0;
return Card(
margin: const EdgeInsets.only(bottom: 12),
child: InkWell(
onTap: () => _openDeck(deck),
borderRadius: BorderRadius.circular(12),
@@ -369,11 +371,45 @@ class _DeckListScreenState extends State<DeckListScreen> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
deck.title,
style: Theme.of(context).textTheme.titleMedium?.copyWith(
fontWeight: FontWeight.bold,
Row(
children: [
Expanded(
child: Text(
deck.title,
style: Theme.of(context).textTheme.titleMedium?.copyWith(
fontWeight: FontWeight.bold,
),
),
),
if (isCompleted) ...[
const SizedBox(width: 8),
Container(
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
decoration: BoxDecoration(
color: Colors.green.shade700,
borderRadius: BorderRadius.circular(12),
),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(
Icons.check_circle,
size: 16,
color: Colors.white,
),
const SizedBox(width: 4),
Text(
'Completed',
style: Theme.of(context).textTheme.labelSmall?.copyWith(
color: Colors.white,
fontWeight: FontWeight.bold,
),
),
],
),
),
],
],
),
if (deck.description.isNotEmpty) ...[
const SizedBox(height: 4),
@@ -384,6 +420,7 @@ class _DeckListScreenState extends State<DeckListScreen> {
overflow: TextOverflow.ellipsis,
),
],
],
),
),