공부시간에 초단위 표시 + 백품타 출석 인정 기준(1시간) 안내 문구 추가
랭킹, 공부 타이머 통계, 그룹 멤버 카드에 초단위까지 표시하고, 출석 달력/그룹 화면에 "1시간 이상 공부해야 출석 인정" 안내를 추가. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -13,6 +13,7 @@ class StudyCalendarController extends ChangeNotifier {
|
|||||||
bool _isBusy = false;
|
bool _isBusy = false;
|
||||||
int _currentStreak = 0;
|
int _currentStreak = 0;
|
||||||
int _longestStreak = 0;
|
int _longestStreak = 0;
|
||||||
|
int _attendanceThresholdSeconds = 3600;
|
||||||
Set<String> _studiedDates = {};
|
Set<String> _studiedDates = {};
|
||||||
Map<String, dynamic> _events = {}; // date -> {title, description}
|
Map<String, dynamic> _events = {}; // date -> {title, description}
|
||||||
DateTime _visibleMonth = DateTime.now();
|
DateTime _visibleMonth = DateTime.now();
|
||||||
@@ -22,6 +23,7 @@ class StudyCalendarController extends ChangeNotifier {
|
|||||||
bool get isBusy => _isBusy;
|
bool get isBusy => _isBusy;
|
||||||
int get currentStreak => _currentStreak;
|
int get currentStreak => _currentStreak;
|
||||||
int get longestStreak => _longestStreak;
|
int get longestStreak => _longestStreak;
|
||||||
|
int get attendanceThresholdSeconds => _attendanceThresholdSeconds;
|
||||||
Set<String> get studiedDates => _studiedDates;
|
Set<String> get studiedDates => _studiedDates;
|
||||||
Map<String, dynamic> get events => _events;
|
Map<String, dynamic> get events => _events;
|
||||||
DateTime get visibleMonth => _visibleMonth;
|
DateTime get visibleMonth => _visibleMonth;
|
||||||
@@ -68,6 +70,8 @@ class StudyCalendarController extends ChangeNotifier {
|
|||||||
final data = jsonDecode(utf8.decode(response.bodyBytes));
|
final data = jsonDecode(utf8.decode(response.bodyBytes));
|
||||||
_currentStreak = (data['currentStreak'] as num?)?.toInt() ?? 0;
|
_currentStreak = (data['currentStreak'] as num?)?.toInt() ?? 0;
|
||||||
_longestStreak = (data['longestStreak'] as num?)?.toInt() ?? 0;
|
_longestStreak = (data['longestStreak'] as num?)?.toInt() ?? 0;
|
||||||
|
_attendanceThresholdSeconds =
|
||||||
|
(data['attendanceThresholdSeconds'] as num?)?.toInt() ?? 3600;
|
||||||
_studiedDates = ((data['studiedDates'] as List<dynamic>?) ?? [])
|
_studiedDates = ((data['studiedDates'] as List<dynamic>?) ?? [])
|
||||||
.map((d) => d.toString())
|
.map((d) => d.toString())
|
||||||
.toSet();
|
.toSet();
|
||||||
|
|||||||
@@ -209,9 +209,12 @@ class _GroupDetailScreenState extends State<GroupDetailScreen> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String _formatMinutes(int seconds) {
|
String _formatMinutes(int seconds) {
|
||||||
final m = seconds ~/ 60;
|
final h = seconds ~/ 3600;
|
||||||
if (m < 60) return '$m분';
|
final m = (seconds % 3600) ~/ 60;
|
||||||
return '${m ~/ 60}시간 ${m % 60}분';
|
final s = seconds % 60;
|
||||||
|
if (h > 0) return '$h시간 $m분';
|
||||||
|
if (m > 0) return '$m분 $s초';
|
||||||
|
return '$s초';
|
||||||
}
|
}
|
||||||
|
|
||||||
void _openTimer() {
|
void _openTimer() {
|
||||||
@@ -412,6 +415,14 @@ class _GroupDetailScreenState extends State<GroupDetailScreen> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
const SizedBox(height: 4),
|
||||||
|
Text(
|
||||||
|
'1시간 이상 공부해야 출석으로 표시돼요.',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 11.5,
|
||||||
|
color: Colors.grey[500],
|
||||||
|
),
|
||||||
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
GridView.builder(
|
GridView.builder(
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
|
|||||||
@@ -234,6 +234,17 @@ class _StudyCalendarScreenState extends State<StudyCalendarScreen> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
const SizedBox(height: 8),
|
||||||
|
Center(
|
||||||
|
child: Text(
|
||||||
|
'하루 ${_controller.attendanceThresholdSeconds ~/ 60}분 '
|
||||||
|
'이상 공부해야 그날 출석으로 인정돼요.',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 11.5,
|
||||||
|
color: Colors.grey[500],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
|||||||
@@ -38,8 +38,10 @@ class _StudyRankingScreenState extends State<StudyRankingScreen> {
|
|||||||
String _formatHM(int totalSeconds) {
|
String _formatHM(int totalSeconds) {
|
||||||
final h = totalSeconds ~/ 3600;
|
final h = totalSeconds ~/ 3600;
|
||||||
final m = (totalSeconds % 3600) ~/ 60;
|
final m = (totalSeconds % 3600) ~/ 60;
|
||||||
if (h > 0) return '$h시간 $m분';
|
final s = totalSeconds % 60;
|
||||||
return '$m분';
|
if (h > 0) return '$h시간 $m분 $s초';
|
||||||
|
if (m > 0) return '$m분 $s초';
|
||||||
|
return '$s초';
|
||||||
}
|
}
|
||||||
|
|
||||||
Color? _rankColor(int rank) {
|
Color? _rankColor(int rank) {
|
||||||
|
|||||||
@@ -114,8 +114,10 @@ class _StudyTimerScreenState extends State<StudyTimerScreen>
|
|||||||
String _formatHM(int totalSeconds) {
|
String _formatHM(int totalSeconds) {
|
||||||
final h = totalSeconds ~/ 3600;
|
final h = totalSeconds ~/ 3600;
|
||||||
final m = (totalSeconds % 3600) ~/ 60;
|
final m = (totalSeconds % 3600) ~/ 60;
|
||||||
if (h > 0) return '$h시간 $m분';
|
final s = totalSeconds % 60;
|
||||||
return '$m분';
|
if (h > 0) return '$h시간 $m분 $s초';
|
||||||
|
if (m > 0) return '$m분 $s초';
|
||||||
|
return '$s초';
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _runAction(
|
Future<void> _runAction(
|
||||||
|
|||||||
Reference in New Issue
Block a user