Muitas coisas e já me esqueci delas todas, cenas principalmente no dashboard do aluno bug fixes e etc

This commit is contained in:
2026-05-17 19:42:49 +01:00
parent 7a26223a01
commit e388ca3b67
20 changed files with 1989 additions and 1224 deletions

View File

@@ -13,7 +13,8 @@ class StudentAchievementsPage extends StatefulWidget {
const StudentAchievementsPage({super.key});
@override
State<StudentAchievementsPage> createState() => _StudentAchievementsPageState();
State<StudentAchievementsPage> createState() =>
_StudentAchievementsPageState();
}
class _StudentAchievementsPageState extends State<StudentAchievementsPage> {
@@ -82,66 +83,45 @@ class _StudentAchievementsPageState extends State<StudentAchievementsPage> {
return Scaffold(
backgroundColor: cs.surface,
appBar: AppBar(
backgroundColor: cs.primary,
foregroundColor: Colors.white,
elevation: 0,
leading: IconButton(
icon: const Icon(Icons.arrow_back),
onPressed: () => context.go('/student-dashboard'),
),
title: const Text(
'Minhas Conquistas',
style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
),
actions: [
Padding(
padding: const EdgeInsets.only(right: 16),
child: Center(
child: Text(
'${_unlockedAchievements.length}/${_allAchievements.length}',
style: TextStyle(
color: Colors.white.withValues(alpha: 0.9),
fontSize: 14,
fontWeight: FontWeight.w500,
),
),
),
),
],
),
body: Container(
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
cs.primary.withValues(alpha: 0.05),
cs.surface,
],
colors: [cs.primary.withValues(alpha: 0.05), cs.surface],
),
),
child: SafeArea(
child: Column(
children: [
// Header
Container(
padding: const EdgeInsets.all(24),
child: Row(
children: [
IconButton(
icon: const Icon(Icons.arrow_back, color: Colors.white),
onPressed: () => context.go('/student-dashboard'),
),
const SizedBox(width: 16),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text(
'Minhas Conquistas',
style: TextStyle(
color: Colors.white,
fontSize: 24,
fontWeight: FontWeight.bold,
),
),
const SizedBox(height: 4),
Text(
'${_unlockedAchievements.length}/${_allAchievements.length} desbloqueadas',
style: TextStyle(
color: Colors.white.withValues(alpha: 0.8),
fontSize: 14,
),
),
],
),
),
],
),
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [cs.primary, cs.primary.withValues(alpha: 0.8)],
),
borderRadius: const BorderRadius.only(
bottomLeft: Radius.circular(20),
bottomRight: Radius.circular(20),
),
),
),
// Content
Expanded(
child: _loading
@@ -203,7 +183,8 @@ class _StudentAchievementsPageState extends State<StudentAchievementsPage> {
return _buildEmptyState(
icon: Icons.emoji_events_outlined,
title: 'Nenhuma conquista desbloqueada',
subtitle: 'Complete quizzes e mantenha seu streak para desbloquear conquistas!',
subtitle:
'Complete quizzes e mantenha seu streak para desbloquear conquistas!',
);
}
@@ -214,7 +195,10 @@ class _StudentAchievementsPageState extends State<StudentAchievementsPage> {
final achievement = _unlockedAchievements[index];
return _buildAchievementCard(achievement, isUnlocked: true)
.animate()
.slideX(duration: const Duration(milliseconds: 300))
.fadeIn(
duration: const Duration(milliseconds: 300),
curve: Curves.easeOut,
)
.then(delay: Duration(milliseconds: index * 50));
},
);
@@ -236,13 +220,19 @@ class _StudentAchievementsPageState extends State<StudentAchievementsPage> {
final achievement = _lockedAchievements[index];
return _buildAchievementCard(achievement, isUnlocked: false)
.animate()
.slideX(duration: const Duration(milliseconds: 300))
.fadeIn(
duration: const Duration(milliseconds: 300),
curve: Curves.easeOut,
)
.then(delay: Duration(milliseconds: index * 50));
},
);
}
Widget _buildAchievementCard(Achievement achievement, {required bool isUnlocked}) {
Widget _buildAchievementCard(
Achievement achievement, {
required bool isUnlocked,
}) {
final cs = Theme.of(context).colorScheme;
final color = _getRarityColor(achievement.rarity);
@@ -253,7 +243,7 @@ class _StudentAchievementsPageState extends State<StudentAchievementsPage> {
color: isUnlocked ? cs.surface : cs.surfaceContainerHighest,
borderRadius: BorderRadius.circular(16),
border: Border.all(
color: isUnlocked
color: isUnlocked
? color.withValues(alpha: 0.3)
: cs.outline.withValues(alpha: 0.2),
width: isUnlocked ? 2 : 1,
@@ -273,7 +263,7 @@ class _StudentAchievementsPageState extends State<StudentAchievementsPage> {
width: 48,
height: 48,
decoration: BoxDecoration(
color: isUnlocked
color: isUnlocked
? color.withValues(alpha: 0.2)
: cs.outline.withValues(alpha: 0.2),
borderRadius: BorderRadius.circular(24),
@@ -302,18 +292,20 @@ class _StudentAchievementsPageState extends State<StudentAchievementsPage> {
const SizedBox(height: 4),
Text(
achievement.description,
style: TextStyle(
color: cs.onSurfaceVariant,
fontSize: 14,
),
style: TextStyle(color: cs.onSurfaceVariant, fontSize: 14),
),
const SizedBox(height: 8),
Row(
children: [
Container(
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
padding: const EdgeInsets.symmetric(
horizontal: 8,
vertical: 4,
),
decoration: BoxDecoration(
color: _getRarityColor(achievement.rarity).withValues(alpha: 0.2),
color: _getRarityColor(
achievement.rarity,
).withValues(alpha: 0.2),
borderRadius: BorderRadius.circular(8),
),
child: Text(
@@ -342,17 +334,9 @@ class _StudentAchievementsPageState extends State<StudentAchievementsPage> {
// Status
if (isUnlocked)
Icon(
Icons.check_circle,
color: Colors.green,
size: 24,
)
Icon(Icons.check_circle, color: Colors.green, size: 24)
else
Icon(
Icons.lock,
color: cs.outline,
size: 24,
),
Icon(Icons.lock, color: cs.outline, size: 24),
],
),
);
@@ -371,11 +355,7 @@ class _StudentAchievementsPageState extends State<StudentAchievementsPage> {
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
icon,
size: 64,
color: cs.onSurfaceVariant,
),
Icon(icon, size: 64, color: cs.onSurfaceVariant),
const SizedBox(height: 16),
Text(
title,
@@ -389,10 +369,7 @@ class _StudentAchievementsPageState extends State<StudentAchievementsPage> {
const SizedBox(height: 8),
Text(
subtitle,
style: TextStyle(
color: cs.onSurfaceVariant,
fontSize: 14,
),
style: TextStyle(color: cs.onSurfaceVariant, fontSize: 14),
textAlign: TextAlign.center,
),
],
@@ -403,29 +380,47 @@ class _StudentAchievementsPageState extends State<StudentAchievementsPage> {
Color _getRarityColor(String rarity) {
switch (rarity) {
case 'common': return Colors.grey;
case 'rare': return Colors.blue;
case 'epic': return Colors.purple;
case 'legendary': return Colors.orange;
default: return Colors.grey;
case 'common':
return Colors.grey;
case 'rare':
return Colors.blue;
case 'epic':
return Colors.purple;
case 'legendary':
return Colors.orange;
default:
return Colors.grey;
}
}
IconData _getIconData(String iconName) {
switch (iconName) {
case 'emoji_events': return Icons.emoji_events;
case 'school': return Icons.school;
case 'local_fire_department': return Icons.local_fire_department;
case 'schedule': return Icons.schedule;
case 'trending_up': return Icons.trending_up;
case 'star': return Icons.star;
case 'military_tech': return Icons.military_tech;
case 'workspace_premium': return Icons.workspace_premium;
case 'psychology': return Icons.psychology;
case 'lightbulb': return Icons.lightbulb;
case 'whatshot': return Icons.whatshot;
case 'stars': return Icons.stars;
default: return Icons.emoji_events;
case 'emoji_events':
return Icons.emoji_events;
case 'school':
return Icons.school;
case 'local_fire_department':
return Icons.local_fire_department;
case 'schedule':
return Icons.schedule;
case 'trending_up':
return Icons.trending_up;
case 'star':
return Icons.star;
case 'military_tech':
return Icons.military_tech;
case 'workspace_premium':
return Icons.workspace_premium;
case 'psychology':
return Icons.psychology;
case 'lightbulb':
return Icons.lightbulb;
case 'whatshot':
return Icons.whatshot;
case 'stars':
return Icons.stars;
default:
return Icons.emoji_events;
}
}
}