diff --git a/lib/screens/teacher_attendance_page.dart b/lib/screens/teacher_attendance_page.dart index 75783dc..731b3b9 100644 --- a/lib/screens/teacher_attendance_page.dart +++ b/lib/screens/teacher_attendance_page.dart @@ -26,6 +26,7 @@ class _TeacherAttendancePageState extends State { Map _activeViolationsByStudentId = {}; // 무단반출 중인 학생 (/api/violations/active) Timer? _timer; bool _isLoading = true; + bool _isRefreshing = false; // 새로고침 버튼 클릭 시 잠깐 도는 표시용 String _filterType = "ALL"; // "ALL", "CHECKED_IN", "ABSENT" @override @@ -41,6 +42,12 @@ class _TeacherAttendancePageState extends State { super.dispose(); } + Future _manualRefresh() async { + setState(() => _isRefreshing = true); + await _fetchAll(); + if (mounted) setState(() => _isRefreshing = false); + } + Future _fetchAll() async { try { final results = await Future.wait([ @@ -275,8 +282,17 @@ class _TeacherAttendancePageState extends State { elevation: 0, actions: [ IconButton( - onPressed: _isLoading ? null : _fetchAll, - icon: const Icon(Icons.refresh_rounded), + onPressed: (_isLoading || _isRefreshing) ? null : _manualRefresh, + icon: _isRefreshing + ? const SizedBox( + width: 20, + height: 20, + child: CircularProgressIndicator( + strokeWidth: 2, + color: Colors.white, + ), + ) + : const Icon(Icons.refresh_rounded), tooltip: '새로고침', ), TextButton.icon(