VERSAO FINAL (core features)
This commit is contained in:
@@ -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,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user