Skip to content

Commit

Permalink
attendence done. but it keeps reloading.
Browse files Browse the repository at this point in the history
  • Loading branch information
atharva-khewle committed Jul 20, 2024
1 parent b101bd2 commit 6357f7a
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions lib/new_ui/screens/attendance_screen/attendance_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
}

Navigator.of(context).pop();
_fetchAndSetAttendance();
},
child: Text('Update', style: TextStyle(color: Colors.blue)),
),
Expand All @@ -248,12 +249,13 @@ class _AttendanceScreenState extends State<AttendanceScreen> {

attendanceList.removeWhere((item) => item['subject_name'] == attendanceInfo['subject_name']);


await FirebaseFirestore.instance
.collection("Attendance")
.doc(FirebaseAuth.instance.currentUser!.uid)
.update({'attendance': attendanceList});
}

_fetchAndSetAttendance();
Navigator.of(context).pop();
},
child: Text('Delete', style: TextStyle(color: Colors.red)),
Expand Down Expand Up @@ -344,11 +346,17 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
Center(
child: Container(
width: size.width * 0.88,
color: commonbgL4ightblack,
child: Text(getTextForCard(attendanceInfo['present'], attendanceInfo['total'])),
decoration: BoxDecoration(
border: Border.all(color: timePickerBorder, width: 1.0),
borderRadius: BorderRadius.circular(10.0),
color: timePickerBg,
),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text(getTextForCard(attendanceInfo['present'], attendanceInfo['total']),style: TextStyle(color: Colors.grey),),
),
),
),
const SizedBox(height: 10,),
],
),
),
Expand Down

0 comments on commit 6357f7a

Please sign in to comment.