Muitas coisas e já me esqueci delas todas, cenas principalmente no dashboard do aluno bug fixes e etc
This commit is contained in:
@@ -10,10 +10,7 @@ import '../../../../core/theme/app_theme_extension.dart';
|
||||
class ClassRankingWidget extends StatefulWidget {
|
||||
final String classId;
|
||||
|
||||
const ClassRankingWidget({
|
||||
super.key,
|
||||
required this.classId,
|
||||
});
|
||||
const ClassRankingWidget({super.key, required this.classId});
|
||||
|
||||
@override
|
||||
State<ClassRankingWidget> createState() => _ClassRankingWidgetState();
|
||||
@@ -60,11 +57,18 @@ class _ClassRankingWidgetState extends State<ClassRankingWidget> {
|
||||
|
||||
List<StudentRanking> get _filteredRankings {
|
||||
if (_searchQuery.isEmpty) return _rankings;
|
||||
|
||||
return _rankings.where((student) =>
|
||||
student.studentName.toLowerCase().contains(_searchQuery.toLowerCase()) ||
|
||||
student.studentEmail.toLowerCase().contains(_searchQuery.toLowerCase())
|
||||
).toList();
|
||||
|
||||
return _rankings
|
||||
.where(
|
||||
(student) =>
|
||||
student.studentName.toLowerCase().contains(
|
||||
_searchQuery.toLowerCase(),
|
||||
) ||
|
||||
student.studentEmail.toLowerCase().contains(
|
||||
_searchQuery.toLowerCase(),
|
||||
),
|
||||
)
|
||||
.toList();
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -118,7 +122,10 @@ class _ClassRankingWidgetState extends State<ClassRankingWidget> {
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 6),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 12,
|
||||
vertical: 6,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white.withValues(alpha: 0.2),
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
@@ -126,7 +133,11 @@ class _ClassRankingWidgetState extends State<ClassRankingWidget> {
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Icon(Icons.leaderboard, color: Colors.white, size: 16),
|
||||
const Icon(
|
||||
Icons.leaderboard,
|
||||
color: Colors.white,
|
||||
size: 16,
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
Text(
|
||||
'Ranking',
|
||||
@@ -177,7 +188,10 @@ class _ClassRankingWidgetState extends State<ClassRankingWidget> {
|
||||
),
|
||||
if (_searchQuery.isNotEmpty)
|
||||
IconButton(
|
||||
icon: Icon(Icons.clear, color: Colors.white.withValues(alpha: 0.7)),
|
||||
icon: Icon(
|
||||
Icons.clear,
|
||||
color: Colors.white.withValues(alpha: 0.7),
|
||||
),
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
_searchQuery = '';
|
||||
@@ -199,7 +213,7 @@ class _ClassRankingWidgetState extends State<ClassRankingWidget> {
|
||||
itemBuilder: (context, index) {
|
||||
final student = _filteredRankings[index];
|
||||
final rankPosition = _rankings.indexOf(student) + 1;
|
||||
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(bottom: 12),
|
||||
child: _buildStudentRankingCard(student, rankPosition),
|
||||
@@ -255,7 +269,7 @@ class _ClassRankingWidgetState extends State<ClassRankingWidget> {
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
Text(
|
||||
'Nenhum aluno na turma',
|
||||
'Nenhum aluno na disciplina',
|
||||
style: TextStyle(
|
||||
color: Colors.white.withValues(alpha: 0.7),
|
||||
fontSize: 18,
|
||||
@@ -276,11 +290,11 @@ class _ClassRankingWidgetState extends State<ClassRankingWidget> {
|
||||
|
||||
Widget _buildStudentRankingCard(StudentRanking student, int rankPosition) {
|
||||
final cs = Theme.of(context).colorScheme;
|
||||
|
||||
|
||||
// Determinar cor baseada na posição
|
||||
Color rankColor;
|
||||
IconData rankIcon;
|
||||
|
||||
|
||||
if (rankPosition == 1) {
|
||||
rankColor = Colors.amber;
|
||||
rankIcon = Icons.emoji_events;
|
||||
@@ -361,7 +375,9 @@ class _ClassRankingWidgetState extends State<ClassRankingWidget> {
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||
decoration: BoxDecoration(
|
||||
color: _getScoreColor(student.overallScore).withValues(alpha: 0.2),
|
||||
color: _getScoreColor(
|
||||
student.overallScore,
|
||||
).withValues(alpha: 0.2),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Text(
|
||||
|
||||
Reference in New Issue
Block a user