From c17a28bad987a5a85b1d7b94f38fe818d8daabeb Mon Sep 17 00:00:00 2001 From: sihoo Date: Tue, 4 Aug 2026 00:52:26 +0900 Subject: [PATCH] =?UTF-8?q?=EC=83=88=EB=A1=9C=EA=B3=A0=EC=B9=A8=20?= =?UTF-8?q?=EB=B2=84=ED=8A=BC=EC=97=90=20=EB=A1=9C=EB=94=A9=20=ED=91=9C?= =?UTF-8?q?=EC=8B=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 버튼을 눌러도 아무 반응이 없어 보인다는 피드백 반영 - 클릭 시 아이콘이 잠깐 스피너로 바뀌도록 해서 실제로 새로고침이 진행 중임을 알 수 있게 함. Co-Authored-By: Claude Sonnet 5 --- lib/screens/teacher_attendance_page.dart | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) 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(