백품타에 친구/그룹 스터디/출석 달력 기능 추가
친구 신청·수락, 그룹 생성·초대(친구 목록에서 선택)·오늘 출석 현황 공유, 개인 연속 출석(스트릭) 달력, 관리자가 날짜별로 선물/이벤트를 등록하는 달력 관리 화면을 추가. 대시보드에 학생용 3개(친구/그룹 스터디/출석 달력) + 교사·관리자용 1개(출석 달력 관리) 타일을 배치. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,289 @@
|
||||
// 🧑🤝🧑 백품타 친구 화면 (UI 전용). "실시간 출석 현황"과 같은 패밀리룩을 따른다.
|
||||
// 서버 통신/상태는 lib/function/friend_controller.dart가 담당한다.
|
||||
import 'package:flutter/material.dart';
|
||||
import '../function/friend_controller.dart';
|
||||
import '../theme/app_palette.dart';
|
||||
import 'app_notice.dart';
|
||||
import 'title_pill.dart';
|
||||
|
||||
class FriendsScreen extends StatefulWidget {
|
||||
final String studentId;
|
||||
final String studentName;
|
||||
|
||||
const FriendsScreen({
|
||||
super.key,
|
||||
required this.studentId,
|
||||
required this.studentName,
|
||||
});
|
||||
|
||||
@override
|
||||
State<FriendsScreen> createState() => _FriendsScreenState();
|
||||
}
|
||||
|
||||
class _FriendsScreenState extends State<FriendsScreen> {
|
||||
late final FriendController _controller;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_controller = FriendController(
|
||||
studentId: widget.studentId,
|
||||
studentName: widget.studentName,
|
||||
);
|
||||
_controller.init();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_controller.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
Future<void> _showAddFriendDialog() async {
|
||||
final idController = TextEditingController();
|
||||
final result = await showDialog<bool>(
|
||||
context: context,
|
||||
builder: (dialogContext) => AlertDialog(
|
||||
title: const Text('친구 추가'),
|
||||
content: TextField(
|
||||
controller: idController,
|
||||
keyboardType: TextInputType.number,
|
||||
decoration: const InputDecoration(
|
||||
labelText: '친구 학번',
|
||||
border: OutlineInputBorder(),
|
||||
),
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.pop(dialogContext, false),
|
||||
child: const Text('취소', style: TextStyle(color: Colors.grey)),
|
||||
),
|
||||
ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: AppPalette.ink,
|
||||
foregroundColor: AppPalette.paper,
|
||||
),
|
||||
onPressed: () => Navigator.pop(dialogContext, true),
|
||||
child: const Text('신청하기'),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
if (result != true || idController.text.trim().isEmpty) return;
|
||||
final (success, message) = await _controller.sendRequest(
|
||||
idController.text.trim(),
|
||||
);
|
||||
if (!mounted) return;
|
||||
AppNotice.show(
|
||||
context,
|
||||
message,
|
||||
icon: success ? Icons.check_circle_rounded : Icons.error_outline_rounded,
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _respond(int requestId, bool accept) async {
|
||||
final (_, message) = await _controller.respondRequest(requestId, accept);
|
||||
if (!mounted) return;
|
||||
AppNotice.show(context, message);
|
||||
}
|
||||
|
||||
Future<void> _remove(String friendId) async {
|
||||
final confirmed = await showDialog<bool>(
|
||||
context: context,
|
||||
builder: (dialogContext) => AlertDialog(
|
||||
title: const Text('친구 삭제'),
|
||||
content: const Text('이 친구를 삭제하시겠습니까?'),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.pop(dialogContext, false),
|
||||
child: const Text('취소', style: TextStyle(color: Colors.grey)),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () => Navigator.pop(dialogContext, true),
|
||||
child: const Text('삭제', style: TextStyle(color: Colors.red)),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
if (confirmed != true) return;
|
||||
final (_, message) = await _controller.removeFriend(friendId);
|
||||
if (!mounted) return;
|
||||
AppNotice.show(context, message);
|
||||
}
|
||||
|
||||
Widget _sectionHeader(String title, {int? count}) {
|
||||
return Row(
|
||||
children: [
|
||||
Container(
|
||||
width: 4,
|
||||
height: 16,
|
||||
decoration: BoxDecoration(
|
||||
color: AppPalette.ink,
|
||||
borderRadius: BorderRadius.circular(2),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
title,
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: AppPalette.ink,
|
||||
),
|
||||
),
|
||||
if (count != null) ...[
|
||||
const SizedBox(width: 6),
|
||||
Text(
|
||||
'$count명',
|
||||
style: TextStyle(fontSize: 13, color: Colors.grey[500]),
|
||||
),
|
||||
],
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListenableBuilder(
|
||||
listenable: _controller,
|
||||
builder: (context, _) {
|
||||
return Scaffold(
|
||||
backgroundColor: AppPalette.mist,
|
||||
appBar: AppBar(
|
||||
backgroundColor: Colors.transparent,
|
||||
foregroundColor: AppPalette.ink,
|
||||
elevation: 0,
|
||||
),
|
||||
floatingActionButton: FloatingActionButton.extended(
|
||||
backgroundColor: AppPalette.ink,
|
||||
foregroundColor: AppPalette.paper,
|
||||
onPressed: _showAddFriendDialog,
|
||||
icon: const Icon(Icons.person_add_rounded),
|
||||
label: const Text('친구 추가'),
|
||||
),
|
||||
body: _controller.isLoading
|
||||
? const Center(child: CircularProgressIndicator())
|
||||
: RefreshIndicator(
|
||||
onRefresh: _controller.refresh,
|
||||
child: ListView(
|
||||
padding: const EdgeInsets.fromLTRB(16, 0, 16, 90),
|
||||
children: [
|
||||
const Center(child: TitlePill('친구')),
|
||||
const SizedBox(height: 20),
|
||||
if (_controller.requests.isNotEmpty) ...[
|
||||
_sectionHeader(
|
||||
'받은 친구 신청',
|
||||
count: _controller.requests.length,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
for (final r in _controller.requests)
|
||||
Container(
|
||||
margin: const EdgeInsets.only(bottom: 8),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: 12,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: AppPalette.paper,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
border: Border.all(color: AppPalette.sage),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
'${r['name']} (${r['studentId']})',
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () =>
|
||||
_respond(r['requestId'] as int, false),
|
||||
child: const Text(
|
||||
'거절',
|
||||
style: TextStyle(color: Colors.grey),
|
||||
),
|
||||
),
|
||||
ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: AppPalette.ink,
|
||||
foregroundColor: AppPalette.paper,
|
||||
),
|
||||
onPressed: () =>
|
||||
_respond(r['requestId'] as int, true),
|
||||
child: const Text('수락'),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
],
|
||||
_sectionHeader('내 친구', count: _controller.friends.length),
|
||||
const SizedBox(height: 10),
|
||||
if (_controller.friends.isEmpty)
|
||||
const Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 12),
|
||||
child: Text(
|
||||
'아직 친구가 없어요. 학번으로 친구를 추가해보세요.',
|
||||
style: TextStyle(color: Colors.grey),
|
||||
),
|
||||
)
|
||||
else
|
||||
for (final f in _controller.friends)
|
||||
Container(
|
||||
margin: const EdgeInsets.only(bottom: 8),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: 12,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: AppPalette.paper,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
border: Border.all(color: AppPalette.sage),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
padding: const EdgeInsets.all(6),
|
||||
decoration: BoxDecoration(
|
||||
color: AppPalette.ink.withValues(
|
||||
alpha: 0.06,
|
||||
),
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: const Icon(
|
||||
Icons.person_rounded,
|
||||
size: 16,
|
||||
color: AppPalette.ink,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
child: Text(
|
||||
'${f['name']} (${f['studentId']})',
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
icon: const Icon(
|
||||
Icons.person_remove_outlined,
|
||||
color: Colors.grey,
|
||||
),
|
||||
onPressed: () =>
|
||||
_remove(f['studentId'] as String),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,316 @@
|
||||
// 👥 백품타 그룹 상세 화면 (UI 전용) - 멤버 오늘 출석 현황, 친구 초대, 그룹 나가기.
|
||||
// 서버 통신/상태는 lib/function/group_detail_controller.dart, friend_controller.dart가 담당한다.
|
||||
import 'package:flutter/material.dart';
|
||||
import '../function/friend_controller.dart';
|
||||
import '../function/group_detail_controller.dart';
|
||||
import '../theme/app_palette.dart';
|
||||
import 'app_notice.dart';
|
||||
import 'title_pill.dart';
|
||||
|
||||
class GroupDetailScreen extends StatefulWidget {
|
||||
final int groupId;
|
||||
final String groupName;
|
||||
final String studentId;
|
||||
|
||||
const GroupDetailScreen({
|
||||
super.key,
|
||||
required this.groupId,
|
||||
required this.groupName,
|
||||
required this.studentId,
|
||||
});
|
||||
|
||||
@override
|
||||
State<GroupDetailScreen> createState() => _GroupDetailScreenState();
|
||||
}
|
||||
|
||||
class _GroupDetailScreenState extends State<GroupDetailScreen> {
|
||||
late final GroupDetailController _controller;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_controller = GroupDetailController(
|
||||
groupId: widget.groupId,
|
||||
studentId: widget.studentId,
|
||||
);
|
||||
_controller.init();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_controller.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
Future<void> _showInviteSheet() async {
|
||||
final friendController = FriendController(
|
||||
studentId: widget.studentId,
|
||||
studentName: '',
|
||||
);
|
||||
await friendController.init();
|
||||
if (!mounted) return;
|
||||
|
||||
final memberIds = _controller.members
|
||||
.map((m) => m['studentId'] as String)
|
||||
.toSet();
|
||||
final invitable = friendController.friends
|
||||
.where((f) => !memberIds.contains(f['studentId']))
|
||||
.toList();
|
||||
|
||||
await showModalBottomSheet<void>(
|
||||
context: context,
|
||||
backgroundColor: AppPalette.paper,
|
||||
shape: const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.vertical(top: Radius.circular(20)),
|
||||
),
|
||||
builder: (sheetContext) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(20),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
const Text(
|
||||
'친구 초대',
|
||||
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 16),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
if (invitable.isEmpty)
|
||||
const Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 16),
|
||||
child: Text(
|
||||
'초대할 수 있는 친구가 없어요.\n(이미 그룹에 있거나 친구가 없어요)',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(color: Colors.grey),
|
||||
),
|
||||
)
|
||||
else
|
||||
ConstrainedBox(
|
||||
constraints: const BoxConstraints(maxHeight: 320),
|
||||
child: ListView(
|
||||
shrinkWrap: true,
|
||||
children: [
|
||||
for (final f in invitable)
|
||||
ListTile(
|
||||
leading: const Icon(
|
||||
Icons.person_rounded,
|
||||
color: AppPalette.ink,
|
||||
),
|
||||
title: Text('${f['name']}'),
|
||||
subtitle: Text('${f['studentId']}'),
|
||||
trailing: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: AppPalette.ink,
|
||||
foregroundColor: AppPalette.paper,
|
||||
),
|
||||
onPressed: () async {
|
||||
final (success, message) = await _controller
|
||||
.invite(
|
||||
f['studentId'] as String,
|
||||
f['name'] as String,
|
||||
);
|
||||
if (sheetContext.mounted) {
|
||||
Navigator.of(sheetContext).pop();
|
||||
}
|
||||
if (!mounted) return;
|
||||
AppNotice.show(
|
||||
context,
|
||||
message,
|
||||
icon: success
|
||||
? Icons.check_circle_rounded
|
||||
: Icons.error_outline_rounded,
|
||||
);
|
||||
},
|
||||
child: const Text('초대'),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
friendController.dispose();
|
||||
}
|
||||
|
||||
Future<void> _leave() async {
|
||||
final confirmed = await showDialog<bool>(
|
||||
context: context,
|
||||
builder: (dialogContext) => AlertDialog(
|
||||
title: const Text('그룹 나가기'),
|
||||
content: Text('${widget.groupName} 그룹에서 나가시겠습니까?'),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.pop(dialogContext, false),
|
||||
child: const Text('취소', style: TextStyle(color: Colors.grey)),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () => Navigator.pop(dialogContext, true),
|
||||
child: const Text('나가기', style: TextStyle(color: Colors.red)),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
if (confirmed != true) return;
|
||||
final (success, message) = await _controller.leave();
|
||||
if (!mounted) return;
|
||||
AppNotice.show(context, message);
|
||||
if (success) Navigator.of(context).pop();
|
||||
}
|
||||
|
||||
String _formatMinutes(int seconds) {
|
||||
final m = seconds ~/ 60;
|
||||
if (m < 60) return '$m분';
|
||||
return '${m ~/ 60}시간 ${m % 60}분';
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListenableBuilder(
|
||||
listenable: _controller,
|
||||
builder: (context, _) {
|
||||
final members = _controller.members;
|
||||
final attendedCount = members
|
||||
.where((m) => m['attendedToday'] == true)
|
||||
.length;
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: AppPalette.mist,
|
||||
appBar: AppBar(
|
||||
backgroundColor: Colors.transparent,
|
||||
foregroundColor: AppPalette.ink,
|
||||
elevation: 0,
|
||||
actions: [
|
||||
IconButton(
|
||||
icon: const Icon(Icons.exit_to_app_rounded),
|
||||
tooltip: '그룹 나가기',
|
||||
onPressed: _leave,
|
||||
),
|
||||
],
|
||||
),
|
||||
floatingActionButton: FloatingActionButton.extended(
|
||||
backgroundColor: AppPalette.ink,
|
||||
foregroundColor: AppPalette.paper,
|
||||
onPressed: _showInviteSheet,
|
||||
icon: const Icon(Icons.person_add_rounded),
|
||||
label: const Text('친구 초대'),
|
||||
),
|
||||
body: _controller.isLoading
|
||||
? const Center(child: CircularProgressIndicator())
|
||||
: RefreshIndicator(
|
||||
onRefresh: _controller.refresh,
|
||||
child: ListView(
|
||||
padding: const EdgeInsets.fromLTRB(16, 0, 16, 90),
|
||||
children: [
|
||||
Center(child: TitlePill(widget.groupName)),
|
||||
const SizedBox(height: 16),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(child: _statPill('전체 멤버', members.length)),
|
||||
const SizedBox(width: 8),
|
||||
Expanded(child: _statPill('오늘 공부함', attendedCount)),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
width: 4,
|
||||
height: 16,
|
||||
decoration: BoxDecoration(
|
||||
color: AppPalette.ink,
|
||||
borderRadius: BorderRadius.circular(2),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
const Text(
|
||||
'오늘 출석 현황',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: AppPalette.ink,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
for (final m in members)
|
||||
Container(
|
||||
margin: const EdgeInsets.only(bottom: 8),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: 12,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: AppPalette.paper,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
border: Border.all(color: AppPalette.sage),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(
|
||||
m['attendedToday'] == true
|
||||
? Icons.check_circle_rounded
|
||||
: Icons.radio_button_unchecked_rounded,
|
||||
color: m['attendedToday'] == true
|
||||
? AppPalette.ink
|
||||
: Colors.grey[350],
|
||||
size: 20,
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
child: Text(
|
||||
'${m['name']}'
|
||||
'${m['role'] == 'owner' ? ' (그룹장)' : ''}',
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
_formatMinutes(
|
||||
(m['todaySeconds'] as num?)?.toInt() ?? 0,
|
||||
),
|
||||
style: TextStyle(
|
||||
color: Colors.grey[500],
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Widget _statPill(String label, int count) {
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(vertical: 14, horizontal: 16),
|
||||
decoration: BoxDecoration(
|
||||
color: AppPalette.paper,
|
||||
borderRadius: BorderRadius.circular(28),
|
||||
border: Border.all(color: AppPalette.sage),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Text(label, style: TextStyle(fontSize: 12, color: Colors.grey[600])),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
'$count명',
|
||||
style: const TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: AppPalette.ink,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,304 @@
|
||||
// 👥 백품타 그룹 스터디 목록 화면 (UI 전용). "실시간 출석 현황"과 같은 패밀리룩을 따른다.
|
||||
// 서버 통신/상태는 lib/function/group_controller.dart가 담당한다.
|
||||
import 'package:flutter/material.dart';
|
||||
import '../function/group_controller.dart';
|
||||
import '../theme/app_palette.dart';
|
||||
import 'app_notice.dart';
|
||||
import 'group_detail_screen.dart';
|
||||
import 'launchpad_transition.dart';
|
||||
import 'title_pill.dart';
|
||||
|
||||
class GroupListScreen extends StatefulWidget {
|
||||
final String studentId;
|
||||
final String studentName;
|
||||
|
||||
const GroupListScreen({
|
||||
super.key,
|
||||
required this.studentId,
|
||||
required this.studentName,
|
||||
});
|
||||
|
||||
@override
|
||||
State<GroupListScreen> createState() => _GroupListScreenState();
|
||||
}
|
||||
|
||||
class _GroupListScreenState extends State<GroupListScreen> {
|
||||
late final GroupController _controller;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_controller = GroupController(
|
||||
studentId: widget.studentId,
|
||||
studentName: widget.studentName,
|
||||
);
|
||||
_controller.init();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_controller.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
Future<void> _showCreateGroupDialog() async {
|
||||
final nameController = TextEditingController();
|
||||
final result = await showDialog<bool>(
|
||||
context: context,
|
||||
builder: (dialogContext) => AlertDialog(
|
||||
title: const Text('그룹 만들기'),
|
||||
content: TextField(
|
||||
controller: nameController,
|
||||
maxLength: 20,
|
||||
decoration: const InputDecoration(
|
||||
labelText: '그룹 이름',
|
||||
border: OutlineInputBorder(),
|
||||
),
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.pop(dialogContext, false),
|
||||
child: const Text('취소', style: TextStyle(color: Colors.grey)),
|
||||
),
|
||||
ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: AppPalette.ink,
|
||||
foregroundColor: AppPalette.paper,
|
||||
),
|
||||
onPressed: () => Navigator.pop(dialogContext, true),
|
||||
child: const Text('만들기'),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
if (result != true || nameController.text.trim().isEmpty) return;
|
||||
final (success, message) = await _controller.createGroup(
|
||||
nameController.text.trim(),
|
||||
);
|
||||
if (!mounted) return;
|
||||
AppNotice.show(
|
||||
context,
|
||||
message,
|
||||
icon: success ? Icons.check_circle_rounded : Icons.error_outline_rounded,
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _respondInvite(int inviteId, bool accept) async {
|
||||
final (_, message) = await _controller.respondInvite(inviteId, accept);
|
||||
if (!mounted) return;
|
||||
AppNotice.show(context, message);
|
||||
}
|
||||
|
||||
Future<void> _openGroup(dynamic group) async {
|
||||
await pushLaunchpad(
|
||||
context,
|
||||
(context) => GroupDetailScreen(
|
||||
groupId: group['groupId'] as int,
|
||||
groupName: group['name'] as String,
|
||||
studentId: widget.studentId,
|
||||
),
|
||||
);
|
||||
_controller.refresh();
|
||||
}
|
||||
|
||||
Widget _sectionHeader(String title, {int? count}) {
|
||||
return Row(
|
||||
children: [
|
||||
Container(
|
||||
width: 4,
|
||||
height: 16,
|
||||
decoration: BoxDecoration(
|
||||
color: AppPalette.ink,
|
||||
borderRadius: BorderRadius.circular(2),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
title,
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: AppPalette.ink,
|
||||
),
|
||||
),
|
||||
if (count != null) ...[
|
||||
const SizedBox(width: 6),
|
||||
Text(
|
||||
'$count개',
|
||||
style: TextStyle(fontSize: 13, color: Colors.grey[500]),
|
||||
),
|
||||
],
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListenableBuilder(
|
||||
listenable: _controller,
|
||||
builder: (context, _) {
|
||||
return Scaffold(
|
||||
backgroundColor: AppPalette.mist,
|
||||
appBar: AppBar(
|
||||
backgroundColor: Colors.transparent,
|
||||
foregroundColor: AppPalette.ink,
|
||||
elevation: 0,
|
||||
),
|
||||
floatingActionButton: FloatingActionButton.extended(
|
||||
backgroundColor: AppPalette.ink,
|
||||
foregroundColor: AppPalette.paper,
|
||||
onPressed: _showCreateGroupDialog,
|
||||
icon: const Icon(Icons.add_rounded),
|
||||
label: const Text('그룹 만들기'),
|
||||
),
|
||||
body: _controller.isLoading
|
||||
? const Center(child: CircularProgressIndicator())
|
||||
: RefreshIndicator(
|
||||
onRefresh: _controller.refresh,
|
||||
child: ListView(
|
||||
padding: const EdgeInsets.fromLTRB(16, 0, 16, 90),
|
||||
children: [
|
||||
const Center(child: TitlePill('그룹 스터디')),
|
||||
const SizedBox(height: 20),
|
||||
if (_controller.invites.isNotEmpty) ...[
|
||||
_sectionHeader(
|
||||
'받은 그룹 초대',
|
||||
count: _controller.invites.length,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
for (final inv in _controller.invites)
|
||||
Container(
|
||||
margin: const EdgeInsets.only(bottom: 8),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: 12,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: AppPalette.paper,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
border: Border.all(color: AppPalette.sage),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
'${inv['groupName']}',
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () => _respondInvite(
|
||||
inv['inviteId'] as int,
|
||||
false,
|
||||
),
|
||||
child: const Text(
|
||||
'거절',
|
||||
style: TextStyle(color: Colors.grey),
|
||||
),
|
||||
),
|
||||
ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: AppPalette.ink,
|
||||
foregroundColor: AppPalette.paper,
|
||||
),
|
||||
onPressed: () => _respondInvite(
|
||||
inv['inviteId'] as int,
|
||||
true,
|
||||
),
|
||||
child: const Text('참여'),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
],
|
||||
_sectionHeader('내 그룹', count: _controller.groups.length),
|
||||
const SizedBox(height: 10),
|
||||
if (_controller.groups.isEmpty)
|
||||
const Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 12),
|
||||
child: Text(
|
||||
'아직 그룹이 없어요. 새 그룹을 만들거나 초대를 기다려보세요.',
|
||||
style: TextStyle(color: Colors.grey),
|
||||
),
|
||||
)
|
||||
else
|
||||
for (final g in _controller.groups)
|
||||
GestureDetector(
|
||||
onTap: () => _openGroup(g),
|
||||
child: Container(
|
||||
margin: const EdgeInsets.only(bottom: 8),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: 14,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: AppPalette.paper,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
border: Border.all(color: AppPalette.sage),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withValues(alpha: 0.03),
|
||||
blurRadius: 12,
|
||||
offset: const Offset(0, 4),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
padding: const EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
color: AppPalette.ink.withValues(
|
||||
alpha: 0.06,
|
||||
),
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: const Icon(
|
||||
Icons.groups_rounded,
|
||||
color: AppPalette.ink,
|
||||
size: 18,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'${g['name']}',
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 15,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'멤버 ${g['memberCount']}명'
|
||||
'${g['isOwner'] == true ? ' · 그룹장' : ''}',
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: Colors.grey[500],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const Icon(
|
||||
Icons.chevron_right_rounded,
|
||||
color: Colors.grey,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -17,10 +17,13 @@ import 'board_report_screen.dart';
|
||||
import 'dashboard_settings_page.dart';
|
||||
import 'device_checkout_ledger_page.dart';
|
||||
import 'device_checkout_request_screen.dart';
|
||||
import 'friends_screen.dart';
|
||||
import 'group_list_screen.dart';
|
||||
import 'launchpad_transition.dart';
|
||||
import 'login_screen.dart';
|
||||
import 'nfc_poccket_checkin_screen.dart';
|
||||
import 'nfc_tag_writer_screen.dart';
|
||||
import 'study_calendar_screen.dart';
|
||||
import 'study_timer_screen.dart';
|
||||
import 'teacher_attendance_page.dart';
|
||||
import 'teacher_call_screen.dart';
|
||||
@@ -365,6 +368,49 @@ class _MainDashboardState extends State<MainDashboard> {
|
||||
),
|
||||
),
|
||||
));
|
||||
tiles.add((
|
||||
id: 'friends',
|
||||
child: _buildModernCard(
|
||||
icon: Icons.people_alt_rounded,
|
||||
title: '친구',
|
||||
subtitle: '학번으로 친구 추가',
|
||||
color: AppPalette.ink,
|
||||
onTap: () => pushLaunchpad(
|
||||
context,
|
||||
(context) =>
|
||||
FriendsScreen(studentId: _displayId, studentName: _displayName),
|
||||
),
|
||||
),
|
||||
));
|
||||
tiles.add((
|
||||
id: 'group_study',
|
||||
child: _buildModernCard(
|
||||
icon: Icons.groups_rounded,
|
||||
title: '그룹 스터디',
|
||||
subtitle: '친구랑 그룹 만들어 같이 공부',
|
||||
color: AppPalette.ink,
|
||||
onTap: () => pushLaunchpad(
|
||||
context,
|
||||
(context) => GroupListScreen(
|
||||
studentId: _displayId,
|
||||
studentName: _displayName,
|
||||
),
|
||||
),
|
||||
),
|
||||
));
|
||||
tiles.add((
|
||||
id: 'study_calendar',
|
||||
child: _buildModernCard(
|
||||
icon: Icons.calendar_month_rounded,
|
||||
title: '출석 달력',
|
||||
subtitle: '연속 출석 기록 확인',
|
||||
color: AppPalette.ink,
|
||||
onTap: () => pushLaunchpad(
|
||||
context,
|
||||
(context) => StudyCalendarScreen(studentId: _displayId),
|
||||
),
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
if (_isTeacherOrAbove) {
|
||||
@@ -423,6 +469,22 @@ class _MainDashboardState extends State<MainDashboard> {
|
||||
),
|
||||
),
|
||||
));
|
||||
tiles.add((
|
||||
id: 'study_calendar_admin',
|
||||
child: _buildModernCard(
|
||||
icon: Icons.event_available_rounded,
|
||||
title: '출석 달력 관리',
|
||||
subtitle: '날짜별 선물/이벤트 등록',
|
||||
color: AppPalette.ink,
|
||||
onTap: () => pushLaunchpad(
|
||||
context,
|
||||
(context) => StudyCalendarScreen(
|
||||
studentId: _displayId,
|
||||
canManageEvents: true,
|
||||
),
|
||||
),
|
||||
),
|
||||
));
|
||||
tiles.add((
|
||||
id: 'teacher_location',
|
||||
child: _buildModernCard(
|
||||
|
||||
@@ -0,0 +1,404 @@
|
||||
// 📅 백품타 출석 달력 화면 (UI 전용) - 개인 연속출석(스트릭) + 관리자 이벤트 달력.
|
||||
// "실시간 출석 현황"과 같은 패밀리룩(제목 알약 + 필 통계 + 둥근 카드)을 따른다.
|
||||
// 서버 통신/상태는 lib/function/study_calendar_controller.dart가 담당한다.
|
||||
import 'package:flutter/material.dart';
|
||||
import '../function/study_calendar_controller.dart';
|
||||
import '../theme/app_palette.dart';
|
||||
import 'app_notice.dart';
|
||||
import 'title_pill.dart';
|
||||
|
||||
class StudyCalendarScreen extends StatefulWidget {
|
||||
final String studentId;
|
||||
final bool canManageEvents;
|
||||
|
||||
const StudyCalendarScreen({
|
||||
super.key,
|
||||
required this.studentId,
|
||||
this.canManageEvents = false,
|
||||
});
|
||||
|
||||
@override
|
||||
State<StudyCalendarScreen> createState() => _StudyCalendarScreenState();
|
||||
}
|
||||
|
||||
class _StudyCalendarScreenState extends State<StudyCalendarScreen> {
|
||||
late final StudyCalendarController _controller;
|
||||
static const _weekdayLabels = ['일', '월', '화', '수', '목', '금', '토'];
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_controller = StudyCalendarController(studentId: widget.studentId);
|
||||
_controller.init();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_controller.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
String _dateKey(DateTime d) =>
|
||||
'${d.year.toString().padLeft(4, '0')}-${d.month.toString().padLeft(2, '0')}-${d.day.toString().padLeft(2, '0')}';
|
||||
|
||||
Future<void> _onDayTap(DateTime day) async {
|
||||
final key = _dateKey(day);
|
||||
final event = _controller.events[key];
|
||||
|
||||
if (!widget.canManageEvents) {
|
||||
if (event != null) {
|
||||
await showDialog<void>(
|
||||
context: context,
|
||||
builder: (dialogContext) => AlertDialog(
|
||||
title: Text(event['title'] ?? ''),
|
||||
content: Text(
|
||||
(event['description'] ?? '').toString().isEmpty
|
||||
? '등록된 설명이 없어요.'
|
||||
: event['description'],
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.pop(dialogContext),
|
||||
child: const Text('닫기'),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
final titleController = TextEditingController(text: event?['title'] ?? '');
|
||||
final descController = TextEditingController(
|
||||
text: event?['description'] ?? '',
|
||||
);
|
||||
|
||||
await showModalBottomSheet<void>(
|
||||
context: context,
|
||||
isScrollControlled: true,
|
||||
backgroundColor: AppPalette.paper,
|
||||
shape: const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.vertical(top: Radius.circular(20)),
|
||||
),
|
||||
builder: (sheetContext) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(
|
||||
left: 20,
|
||||
right: 20,
|
||||
top: 20,
|
||||
bottom: MediaQuery.of(sheetContext).viewInsets.bottom + 20,
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
Text(
|
||||
'$key 이벤트',
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
TextField(
|
||||
controller: titleController,
|
||||
maxLength: 30,
|
||||
decoration: InputDecoration(
|
||||
hintText: '제목 (예: 기프티콘 이벤트)',
|
||||
filled: true,
|
||||
fillColor: AppPalette.mist,
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: BorderSide.none,
|
||||
),
|
||||
),
|
||||
),
|
||||
TextField(
|
||||
controller: descController,
|
||||
maxLength: 100,
|
||||
maxLines: 3,
|
||||
decoration: InputDecoration(
|
||||
hintText: '설명 (선택)',
|
||||
filled: true,
|
||||
fillColor: AppPalette.mist,
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: BorderSide.none,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Row(
|
||||
children: [
|
||||
if (event != null)
|
||||
Expanded(
|
||||
child: OutlinedButton(
|
||||
onPressed: () async {
|
||||
final (success, message) = await _controller
|
||||
.deleteEvent(key);
|
||||
if (sheetContext.mounted) {
|
||||
Navigator.of(sheetContext).pop();
|
||||
}
|
||||
if (!mounted) return;
|
||||
AppNotice.show(context, message);
|
||||
},
|
||||
child: const Text(
|
||||
'삭제',
|
||||
style: TextStyle(color: Colors.red),
|
||||
),
|
||||
),
|
||||
),
|
||||
if (event != null) const SizedBox(width: 8),
|
||||
Expanded(
|
||||
child: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: AppPalette.ink,
|
||||
foregroundColor: AppPalette.paper,
|
||||
),
|
||||
onPressed: () async {
|
||||
if (titleController.text.trim().isEmpty) return;
|
||||
final (success, message) = await _controller.saveEvent(
|
||||
date: key,
|
||||
title: titleController.text,
|
||||
description: descController.text,
|
||||
createdBy: widget.studentId,
|
||||
);
|
||||
if (sheetContext.mounted) {
|
||||
Navigator.of(sheetContext).pop();
|
||||
}
|
||||
if (!mounted) return;
|
||||
AppNotice.show(
|
||||
context,
|
||||
message,
|
||||
icon: success
|
||||
? Icons.check_circle_rounded
|
||||
: Icons.error_outline_rounded,
|
||||
);
|
||||
},
|
||||
child: const Text('저장'),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListenableBuilder(
|
||||
listenable: _controller,
|
||||
builder: (context, _) {
|
||||
final month = _controller.visibleMonth;
|
||||
final firstOfMonth = DateTime(month.year, month.month, 1);
|
||||
final daysInMonth = DateTime(month.year, month.month + 1, 0).day;
|
||||
final leadingBlanks = firstOfMonth.weekday % 7;
|
||||
final today = DateTime.now();
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: AppPalette.mist,
|
||||
appBar: AppBar(
|
||||
backgroundColor: Colors.transparent,
|
||||
foregroundColor: AppPalette.ink,
|
||||
elevation: 0,
|
||||
),
|
||||
body: _controller.isLoading
|
||||
? const Center(child: CircularProgressIndicator())
|
||||
: ListView(
|
||||
padding: const EdgeInsets.fromLTRB(16, 0, 16, 16),
|
||||
children: [
|
||||
const Center(child: TitlePill('출석 달력')),
|
||||
const SizedBox(height: 16),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: _statPill('연속 출석', _controller.currentStreak),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Expanded(
|
||||
child: _statPill('최장 기록', _controller.longestStreak),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
IconButton(
|
||||
icon: const Icon(Icons.chevron_left_rounded),
|
||||
onPressed: _controller.goToPreviousMonth,
|
||||
),
|
||||
Text(
|
||||
'${month.year}년 ${month.month}월',
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
icon: const Icon(Icons.chevron_right_rounded),
|
||||
onPressed: _controller.goToNextMonth,
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Row(
|
||||
children: [
|
||||
for (final label in _weekdayLabels)
|
||||
Expanded(
|
||||
child: Center(
|
||||
child: Text(
|
||||
label,
|
||||
style: TextStyle(
|
||||
color: Colors.grey[500],
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 6),
|
||||
GridView.builder(
|
||||
shrinkWrap: true,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
gridDelegate:
|
||||
const SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 7,
|
||||
mainAxisSpacing: 6,
|
||||
crossAxisSpacing: 6,
|
||||
childAspectRatio: 0.85,
|
||||
),
|
||||
itemCount: leadingBlanks + daysInMonth,
|
||||
itemBuilder: (context, index) {
|
||||
if (index < leadingBlanks) {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
final day = index - leadingBlanks + 1;
|
||||
final date = DateTime(month.year, month.month, day);
|
||||
final key = _dateKey(date);
|
||||
final studied = _controller.studiedDates.contains(key);
|
||||
final event = _controller.events[key];
|
||||
final isToday =
|
||||
date.year == today.year &&
|
||||
date.month == today.month &&
|
||||
date.day == today.day;
|
||||
|
||||
return GestureDetector(
|
||||
onTap: () => _onDayTap(date),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: studied
|
||||
? AppPalette.ink
|
||||
: AppPalette.paper,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
border: Border.all(
|
||||
color: isToday
|
||||
? AppPalette.ink
|
||||
: AppPalette.sage,
|
||||
width: isToday ? 2 : 1,
|
||||
),
|
||||
),
|
||||
child: Stack(
|
||||
children: [
|
||||
Center(
|
||||
child: Text(
|
||||
'$day',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: studied
|
||||
? Colors.white
|
||||
: AppPalette.ink,
|
||||
),
|
||||
),
|
||||
),
|
||||
if (event != null)
|
||||
Positioned(
|
||||
top: 3,
|
||||
right: 3,
|
||||
child: Icon(
|
||||
Icons.card_giftcard_rounded,
|
||||
size: 12,
|
||||
color: studied
|
||||
? Colors.white
|
||||
: Colors.orange,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
Row(
|
||||
children: [
|
||||
_legendDot(AppPalette.ink, '공부한 날'),
|
||||
const SizedBox(width: 16),
|
||||
_legendIcon(
|
||||
Icons.card_giftcard_rounded,
|
||||
Colors.orange,
|
||||
'이벤트',
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Widget _statPill(String label, int count) {
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(vertical: 14, horizontal: 16),
|
||||
decoration: BoxDecoration(
|
||||
color: AppPalette.paper,
|
||||
borderRadius: BorderRadius.circular(28),
|
||||
border: Border.all(color: AppPalette.sage),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Text(label, style: TextStyle(fontSize: 12, color: Colors.grey[600])),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
'$count일',
|
||||
style: const TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: AppPalette.ink,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _legendDot(Color color, String label) {
|
||||
return Row(
|
||||
children: [
|
||||
Container(
|
||||
width: 12,
|
||||
height: 12,
|
||||
decoration: BoxDecoration(color: color, shape: BoxShape.circle),
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
Text(label, style: TextStyle(fontSize: 12, color: Colors.grey[600])),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _legendIcon(IconData icon, Color color, String label) {
|
||||
return Row(
|
||||
children: [
|
||||
Icon(icon, size: 14, color: color),
|
||||
const SizedBox(width: 6),
|
||||
Text(label, style: TextStyle(fontSize: 12, color: Colors.grey[600])),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user