VERSAO FINAL (core features)

This commit is contained in:
2026-05-17 18:27:22 +01:00
parent ba58228467
commit 7a26223a01
5 changed files with 203 additions and 56 deletions

View File

@@ -13,6 +13,7 @@ class ClassStats {
final int totalContent;
final List<WeeklyStats> weeklyStats;
final List<StudentNeedingSupport> studentsNeedingSupport;
final DateTime? lastUpdated;
const ClassStats({
required this.classId,
@@ -26,6 +27,7 @@ class ClassStats {
required this.totalContent,
required this.weeklyStats,
required this.studentsNeedingSupport,
this.lastUpdated,
});
factory ClassStats.fromFirestore(Map<String, dynamic> data, String classId) {
@@ -47,6 +49,7 @@ class ClassStats {
?.map((s) => StudentNeedingSupport.fromFirestore(s))
.toList() ??
[],
lastUpdated: (data['lastUpdated'] as Timestamp?)?.toDate(),
);
}
@@ -62,6 +65,7 @@ class ClassStats {
'totalContent': totalContent,
'weeklyStats': weeklyStats.map((w) => w.toFirestore()).toList(),
'studentsNeedingSupport': studentsNeedingSupport.map((s) => s.toFirestore()).toList(),
'lastUpdated': lastUpdated != null ? Timestamp.fromDate(lastUpdated!) : null,
};
}
}