13 Commits
Author SHA1 Message Date
sihoo 4e12b279e2 선생님 정상 로그인 시 대시보드 이름 표시 버그 수정 + 앱 버전 1.1.4
- 로그인 성공 후 TeacherDashboard로 이동할 때 실제 이름/학번을 안 넘겨줘서
  항상 "간편인증 선생"으로 표시되던 문제 수정
2026-08-05 14:01:50 +09:00
sihoo d864927957 전체 반출 허용 중일 때 대시보드에 배너 표시 추가 2026-08-04 14:55:22 +09:00
sihoo 61aedac312 한 번도 태깅 안 한 학생은 미제출 대신 미등록으로 표시 2026-08-04 14:47:15 +09:00
sihoo 5ab1c4c37c 하교 처리 후 무단반출 오탐 버그 수정 + 앱 버전 1.1.3
- 조도 센서가 폰 반출을 감지하면, 위반 경고를 울리기 전에 서버에 반출 허용 상태(하교/허용시간대)를 먼저 확인
- 허용된 상태면 위반 경고 없이 조용히 정상 회수로 처리
2026-08-04 14:36:38 +09:00
sihoo 3a62ebacd8 출석/무단반출 팝업 중복 표시 버그 수정 + 앱 버전 1.1.2
- 새 팝업(출석완료/무단반출)을 띄우기 전 이전에 열려있던 팝업을 먼저 닫도록 수정
- 재태깅이 짧은 간격으로 반복되면 팝업이 여러 개 겹쳐 쌓이던 문제 해결
2026-08-04 14:24:35 +09:00
sihoo 26fb4c32cf 테스트용 허용시간 초기화 디버그 버튼 추가 2026-08-04 14:15:20 +09:00
sihoo 4137a6815c 자습실 출석시간 지정 기능 추가 + 앱 버전 1.1.1
- 대시보드에서 자습실 출석시간(HH:MM) 지정 가능, 하교 시 자동 초기화
- 지정 시간 이전 태깅은 "출석 미완료", 이후는 시간 강조 표시로 구분
2026-08-04 14:01:50 +09:00
sihooandClaude Sonnet 5 4ff063c76d 하교 처리 시 출석 현황 표시도 함께 초기화
하교 버튼을 누르면 반출 허용뿐 아니라, 그 시각을 기준선으로 삼아 대시보드의
"출석 완료" 표시도 미제출로 초기화되도록 함. 실제 출석 기록(attendance 테이블)은
삭제하지 않고, 대시보드가 "오늘 출석"으로 인정하는 기준 시각만 옮기는 방식이라
데이터 손실 없이 표시만 리셋된다.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-04 01:25:20 +09:00
sihooandClaude Sonnet 5 77688170b7 하교 버튼 추가 + 무단반출 후 재태깅 시 재출석 처리 + 테스트용 감시종료 버튼 제거
- 선생님 대시보드에 "하교" 버튼 추가: 시간 입력 없이 바로 전체 학생 반출 허용
  (실수 클릭 방지를 위해 확인 다이얼로그 한 번 거침)
- 무단반출이 감지되면 클라이언트의 감시 상태를 해제해서, 다음 태깅이
  체크아웃이 아니라 새 출석으로 처리되도록 수정
- 주머니 감시 화면에 있던 "폰 회수하고 감시 종료 (테스트용)" 버튼 제거
  (정식 플로우는 재태깅으로만 체크아웃/재출석 처리)

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-04 01:08:48 +09:00
sihooandClaude Sonnet 5 c17a28bad9 새로고침 버튼에 로딩 표시 추가
버튼을 눌러도 아무 반응이 없어 보인다는 피드백 반영 - 클릭 시 아이콘이
잠깐 스피너로 바뀌도록 해서 실제로 새로고침이 진행 중임을 알 수 있게 함.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-04 00:52:26 +09:00
sihooandClaude Sonnet 5 9adaba10cd 교사 대시보드에 새로고침 버튼 추가 + 웹 배포 캐시 무효화 설정
- TeacherAttendancePage 앱바에 수동 새로고침 버튼 추가
- Firebase Hosting에서 index.html/flutter_service_worker.js/version.json을
  no-cache로 설정해서, 재배포 후 브라우저가 예전 버전을 계속 들고 있는 문제 방지

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-04 00:42:15 +09:00
sihoo 77ef666e16 Merge README update from remote 2026-08-04 00:33:47 +09:00
sihooandClaude Sonnet 5 c8ed8f2fd2 교사 데스크톱 대시보드 + 무단반출 허용 기능 추가
- 실시간 출석 현황 화면(TeacherAttendancePage)에 데스크톱(웹 브라우저 800px+) 전용
  레이아웃 추가: 통계 타일 3개 + 정식 DataTable. 교사 대시보드 메뉴 그리드도
  데스크톱에서 카드가 지나치게 커지지 않도록 최대 너비 제한
- Firebase Hosting에 웹 빌드 배포 설정 추가 (firebase.json hosting 섹션),
  https://school-display-ff28f.web.app 로 선생님이 브라우저에서 바로 접속 가능
- 무단 반출(/api/violations/active) 감지 시 대시보드에 빨간 표시 + "반출 허용" 버튼 추가
- 선생님이 개별 학생에게 N분간 반출 허용(/api/violations/allow), 또는 전체 학생에게
  한 번에 반출 허용 시간대 설정(/api/permissions/window, 쉬는시간 등) 가능하도록 연동

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-04 00:32:30 +09:00
7 changed files with 937 additions and 143 deletions
+1 -1
View File
@@ -1 +1 @@
{"flutter":{"platforms":{"android":{"default":{"projectId":"school-display-ff28f","appId":"1:137322214849:android:2595999513206bdeb16b40","fileOutput":"android/app/google-services.json"}},"dart":{"lib/firebase_options.dart":{"projectId":"school-display-ff28f","configurations":{"android":"1:137322214849:android:2595999513206bdeb16b40","web":"1:137322214849:web:0423e5c788d95761b16b40"}}}}}}
{"flutter":{"platforms":{"android":{"default":{"projectId":"school-display-ff28f","appId":"1:137322214849:android:2595999513206bdeb16b40","fileOutput":"android/app/google-services.json"}},"dart":{"lib/firebase_options.dart":{"projectId":"school-display-ff28f","configurations":{"android":"1:137322214849:android:2595999513206bdeb16b40","web":"1:137322214849:web:0423e5c788d95761b16b40"}}}}},"hosting":{"public":"build/web","ignore":["firebase.json","**/.*"],"rewrites":[{"source":"**","destination":"/index.html"}],"headers":[{"source":"/index.html","headers":[{"key":"Cache-Control","value":"no-cache, no-store, must-revalidate"}]},{"source":"/flutter_service_worker.js","headers":[{"key":"Cache-Control","value":"no-cache, no-store, must-revalidate"}]},{"source":"/version.json","headers":[{"key":"Cache-Control","value":"no-cache, no-store, must-revalidate"}]}]}}
+34 -16
View File
@@ -34,6 +34,8 @@ class _NfcPocketCheckInScreenState extends State<NfcPocketCheckInScreen> {
String? _activePocketNumber;
StreamSubscription<Map<String, dynamic>?>? _violationSub;
StreamSubscription<Map<String, dynamic>?>? _checkedOutSub;
bool _isDialogOpen = false; // 출석/위반 팝업이 겹쳐서 뜨는 것을 막기 위한 플래그
bool get _watchServiceSupported => !kIsWeb && Platform.isAndroid;
@@ -43,10 +45,24 @@ class _NfcPocketCheckInScreenState extends State<NfcPocketCheckInScreen> {
_startNfcSession();
if (_watchServiceSupported) {
// 화면이 열려있는 동안은 실시간으로 위반 알림을 받아 팝업을 띄운다.
// 무단 반출이 한 번 감지되면 "신뢰된 감시 세션"은 끝난 것으로 보고,
// 다음 태깅은 체크아웃이 아니라 새 출석(재출석)으로 처리되도록 감시 상태를 해제한다.
_violationSub = FlutterBackgroundService().on('violation_detected').listen((
event,
) {
if (mounted) _showViolationDialog(event?['pocketNumber']?.toString());
if (!mounted) return;
setState(() => _isWatching = false);
_showViolationDialog(event?['pocketNumber']?.toString());
});
// 🏫 하교 처리 등으로 반출이 허용된 상태에서 폰을 꺼내면, 위반이 아니라 정상 회수로 처리된다.
_checkedOutSub = FlutterBackgroundService().on('checked_out').listen((event) {
if (!mounted) return;
setState(() {
_isWatching = false;
_activePocketNumber = null;
_statusMessage = "✅ 폰을 회수했습니다. 수고하셨습니다!";
});
_showSnackBar("✅ 폰이 정상적으로 회수되었습니다.", Colors.green);
});
}
}
@@ -56,6 +72,7 @@ class _NfcPocketCheckInScreenState extends State<NfcPocketCheckInScreen> {
// 화면을 나갈 때 NFC 감지만 종료. 백그라운드 감시 서비스는 화면과 무관하게 계속 동작해야 하므로 건드리지 않는다.
NfcManager.instance.stopSession();
_violationSub?.cancel();
_checkedOutSub?.cancel();
super.dispose();
}
@@ -207,7 +224,18 @@ class _NfcPocketCheckInScreenState extends State<NfcPocketCheckInScreen> {
_showSnackBar("✅ 감시가 종료되었습니다. 수고하셨습니다!", Colors.green);
}
/// 이미 떠 있는 팝업(출석 완료/무단반출 감지)이 있으면 새 팝업을 띄우기 전에 먼저 닫는다.
/// (태깅→반출→재태깅이 빠르게 반복되면 팝업이 여러 개 겹쳐 쌓이는 것을 방지)
void _closeAnyOpenDialog() {
if (_isDialogOpen && mounted) {
Navigator.of(context, rootNavigator: true).pop();
}
_isDialogOpen = false;
}
void _showViolationDialog(String? pocketNumber) {
_closeAnyOpenDialog();
_isDialogOpen = true;
showDialog(
context: context,
builder: (context) => AlertDialog(
@@ -226,11 +254,13 @@ class _NfcPocketCheckInScreenState extends State<NfcPocketCheckInScreen> {
),
],
),
);
).then((_) => _isDialogOpen = false);
}
/// 🎊 출석 성공 알림창
void _showSuccessDialog(String pocketNumber) {
_closeAnyOpenDialog();
_isDialogOpen = true;
showDialog(
context: context,
builder: (context) => AlertDialog(
@@ -245,7 +275,7 @@ class _NfcPocketCheckInScreenState extends State<NfcPocketCheckInScreen> {
),
],
),
);
).then((_) => _isDialogOpen = false);
}
void _showSnackBar(String text, Color color) {
@@ -354,22 +384,10 @@ class _NfcPocketCheckInScreenState extends State<NfcPocketCheckInScreen> {
),
const SizedBox(height: 8),
const Text(
"📴 화면을 꺼도 감시는 계속됩니다.\n알림바에서 상태를 확인할 수 있어요.",
"📴 화면을 꺼도 감시는 계속됩니다.\n알림바에서 상태를 확인할 수 있어요.\n(폰을 꺼내 다시 태깅하면 반출 처리됩니다)",
textAlign: TextAlign.center,
style: TextStyle(color: Colors.white38, fontSize: 13),
),
const SizedBox(height: 40),
OutlinedButton.icon(
onPressed: _checkOut,
icon: const Icon(Icons.logout_rounded, color: Colors.white70),
label: const Text(
"폰 회수하고 감시 종료 (테스트용)",
style: TextStyle(color: Colors.white70),
),
style: OutlinedButton.styleFrom(
side: const BorderSide(color: Colors.white30),
),
),
],
),
),
+25 -1
View File
@@ -112,6 +112,30 @@ void onPocketWatchServiceStart(ServiceInstance service) {
}
}
/// 하교 처리/반출 허용 시간대라면 조용히 감시만 종료하고, 아니면 위반으로 경고한다.
Future<void> handlePhoneRemoved() async {
bool isPermitted = false;
try {
final res = await http.get(
Uri.parse("$baseUrl/api/permissions/check?studentId=$studentId"),
);
if (res.statusCode == 200) {
final data = jsonDecode(utf8.decode(res.bodyBytes));
isPermitted = data['permitted'] == true;
}
} catch (_) {
isPermitted = false; // 네트워크 오류 시엔 안전하게 위반으로 처리
}
if (isPermitted) {
updateNotification("✅ 폰 회수 완료", "[$pocketNumber] 주머니에서 정상적으로 회수되었습니다.");
service.invoke('checked_out', {"pocketNumber": pocketNumber});
service.stopSelf();
} else {
reportViolation();
}
}
void onLightReading(int luxValue) {
if (violated) return;
@@ -129,7 +153,7 @@ void onPocketWatchServiceStart(ServiceInstance service) {
if (luxValue > baselineLux! + _luxJumpThreshold) {
violated = true;
lightSub?.cancel();
reportViolation();
handlePhoneRemoved();
}
}
+4 -1
View File
@@ -308,7 +308,10 @@ class _LoginScreenState extends State<LoginScreen> {
if (role == 'teacher') {
Navigator.pushReplacement(
context,
MaterialPageRoute(builder: (context) => const TeacherDashboard()),
MaterialPageRoute(
builder: (context) =>
TeacherDashboard(teacherId: studentId, teacherName: name),
),
);
} else if (role == 'admin') {
Navigator.pushReplacement(
File diff suppressed because it is too large Load Diff
+17 -11
View File
@@ -135,16 +135,20 @@ class _TeacherDashboardState extends State<TeacherDashboard> {
const SizedBox(height: 16),
// 📊 [그리드 레이아웃 메뉴] 시후의 카드 컴포넌트 스타일 적용
Padding(
padding: const EdgeInsets.symmetric(horizontal: 24.0),
child: GridView.count(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
crossAxisCount: 2,
crossAxisSpacing: 16,
mainAxisSpacing: 16,
childAspectRatio: 0.95,
children: [
// 🖥️ 데스크톱 브라우저에서 카드가 지나치게 커지지 않도록 최대 너비를 제한한다.
Center(
child: ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 700),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 24.0),
child: GridView.count(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
crossAxisCount: 2,
crossAxisSpacing: 16,
mainAxisSpacing: 16,
childAspectRatio: 0.95,
children: [
_buildModernCard(
icon: Icons.assignment_turned_in_rounded,
title: '실시간 출석 확인',
@@ -170,7 +174,9 @@ class _TeacherDashboardState extends State<TeacherDashboard> {
),
),
),
],
],
),
),
),
),
const SizedBox(height: 32),
+1 -1
View File
@@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 1.0.0+1
version: 1.1.4+5
environment:
sdk: ^3.12.2