From 37f67540dddfc2463990cb813671a2b8a4a0edb6 Mon Sep 17 00:00:00 2001 From: sihoo Date: Tue, 29 Sep 2026 06:40:15 +0000 Subject: [PATCH] =?UTF-8?q?=EA=B3=B5=EB=B6=80=EC=8B=9C=EA=B0=84=EC=97=90?= =?UTF-8?q?=20=EC=B4=88=EB=8B=A8=EC=9C=84=20=ED=91=9C=EC=8B=9C=20+=20?= =?UTF-8?q?=EB=B0=B1=ED=92=88=ED=83=80=20=EC=B6=9C=EC=84=9D=20=EC=9D=B8?= =?UTF-8?q?=EC=A0=95=20=EA=B8=B0=EC=A4=80(1=EC=8B=9C=EA=B0=84)=20=EC=95=88?= =?UTF-8?q?=EB=82=B4=20=EB=AC=B8=EA=B5=AC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 랭킹, 공부 타이머 통계, 그룹 멤버 카드에 초단위까지 표시하고, 출석 달력/그룹 화면에 "1시간 이상 공부해야 출석 인정" 안내를 추가. Co-Authored-By: Claude Sonnet 5 --- lib/function/study_calendar_controller.dart | 4 ++++ lib/ui/group_detail_screen.dart | 17 ++++++++++++++--- lib/ui/study_calendar_screen.dart | 11 +++++++++++ lib/ui/study_ranking_screen.dart | 6 ++++-- lib/ui/study_timer_screen.dart | 6 ++++-- 5 files changed, 37 insertions(+), 7 deletions(-) diff --git a/lib/function/study_calendar_controller.dart b/lib/function/study_calendar_controller.dart index 7293256..d9e7291 100644 --- a/lib/function/study_calendar_controller.dart +++ b/lib/function/study_calendar_controller.dart @@ -13,6 +13,7 @@ class StudyCalendarController extends ChangeNotifier { bool _isBusy = false; int _currentStreak = 0; int _longestStreak = 0; + int _attendanceThresholdSeconds = 3600; Set _studiedDates = {}; Map _events = {}; // date -> {title, description} DateTime _visibleMonth = DateTime.now(); @@ -22,6 +23,7 @@ class StudyCalendarController extends ChangeNotifier { bool get isBusy => _isBusy; int get currentStreak => _currentStreak; int get longestStreak => _longestStreak; + int get attendanceThresholdSeconds => _attendanceThresholdSeconds; Set get studiedDates => _studiedDates; Map get events => _events; DateTime get visibleMonth => _visibleMonth; @@ -68,6 +70,8 @@ class StudyCalendarController extends ChangeNotifier { final data = jsonDecode(utf8.decode(response.bodyBytes)); _currentStreak = (data['currentStreak'] as num?)?.toInt() ?? 0; _longestStreak = (data['longestStreak'] as num?)?.toInt() ?? 0; + _attendanceThresholdSeconds = + (data['attendanceThresholdSeconds'] as num?)?.toInt() ?? 3600; _studiedDates = ((data['studiedDates'] as List?) ?? []) .map((d) => d.toString()) .toSet(); diff --git a/lib/ui/group_detail_screen.dart b/lib/ui/group_detail_screen.dart index a8d5148..573109b 100644 --- a/lib/ui/group_detail_screen.dart +++ b/lib/ui/group_detail_screen.dart @@ -209,9 +209,12 @@ class _GroupDetailScreenState extends State { } String _formatMinutes(int seconds) { - final m = seconds ~/ 60; - if (m < 60) return '$m분'; - return '${m ~/ 60}시간 ${m % 60}분'; + final h = seconds ~/ 3600; + final m = (seconds % 3600) ~/ 60; + final s = seconds % 60; + if (h > 0) return '$h시간 $m분'; + if (m > 0) return '$m분 $s초'; + return '$s초'; } void _openTimer() { @@ -412,6 +415,14 @@ class _GroupDetailScreenState extends State { ), ], ), + const SizedBox(height: 4), + Text( + '1시간 이상 공부해야 출석으로 표시돼요.', + style: TextStyle( + fontSize: 11.5, + color: Colors.grey[500], + ), + ), const SizedBox(height: 10), GridView.builder( shrinkWrap: true, diff --git a/lib/ui/study_calendar_screen.dart b/lib/ui/study_calendar_screen.dart index 5856a54..1f5463a 100644 --- a/lib/ui/study_calendar_screen.dart +++ b/lib/ui/study_calendar_screen.dart @@ -234,6 +234,17 @@ class _StudyCalendarScreenState extends State { ), ], ), + const SizedBox(height: 8), + Center( + child: Text( + '하루 ${_controller.attendanceThresholdSeconds ~/ 60}분 ' + '이상 공부해야 그날 출석으로 인정돼요.', + style: TextStyle( + fontSize: 11.5, + color: Colors.grey[500], + ), + ), + ), const SizedBox(height: 20), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, diff --git a/lib/ui/study_ranking_screen.dart b/lib/ui/study_ranking_screen.dart index 592f48e..3b81fad 100644 --- a/lib/ui/study_ranking_screen.dart +++ b/lib/ui/study_ranking_screen.dart @@ -38,8 +38,10 @@ class _StudyRankingScreenState extends State { String _formatHM(int totalSeconds) { final h = totalSeconds ~/ 3600; final m = (totalSeconds % 3600) ~/ 60; - if (h > 0) return '$h시간 $m분'; - return '$m분'; + final s = totalSeconds % 60; + if (h > 0) return '$h시간 $m분 $s초'; + if (m > 0) return '$m분 $s초'; + return '$s초'; } Color? _rankColor(int rank) { diff --git a/lib/ui/study_timer_screen.dart b/lib/ui/study_timer_screen.dart index b2438d9..f368634 100644 --- a/lib/ui/study_timer_screen.dart +++ b/lib/ui/study_timer_screen.dart @@ -114,8 +114,10 @@ class _StudyTimerScreenState extends State String _formatHM(int totalSeconds) { final h = totalSeconds ~/ 3600; final m = (totalSeconds % 3600) ~/ 60; - if (h > 0) return '$h시간 $m분'; - return '$m분'; + final s = totalSeconds % 60; + if (h > 0) return '$h시간 $m분 $s초'; + if (m > 0) return '$m분 $s초'; + return '$s초'; } Future _runAction(