선생님 호출 화면을 실시간 출석 현황과 같은 패밀리룩으로 재디자인

제목을 AppBar 대신 본문 상단 알약(TitlePill)으로 옮기고, 필 모양
통계/선택 버튼과 그림자 있는 둥근 타일(원형 아이콘 배지 + 코너 배지)
스타일을 출석 화면에서 그대로 가져왔다.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-18 03:57:10 +00:00
co-authored by Claude Sonnet 5
parent 4cf759de62
commit 86a8f7b9d1
2 changed files with 319 additions and 124 deletions
+98 -32
View File
@@ -1,4 +1,5 @@
// 📍 선생님 위치 등록 화면(교사용) (UI 전용). 본인 위치를 바꾸고, 받은 호출을 확인한다.
// 📍 선생님 위치 등록 화면(교사용) (UI 전용). "실시간 출석 현황" 화면과 같은 패밀리룩
// (제목 알약 + 필 모양 통계 + 그림자 있는 둥근 타일)을 따른다.
// 서버 통신/상태는 lib/function/teacher_location_controller.dart가 담당한다.
import 'package:flutter/material.dart';
import '../data/teacher_call_schedule.dart';
@@ -42,6 +43,37 @@ class _TeacherLocationScreenState extends State<TeacherLocationScreen> {
);
}
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(
@@ -53,54 +85,56 @@ class _TeacherLocationScreenState extends State<TeacherLocationScreen> {
backgroundColor: Colors.transparent,
foregroundColor: AppPalette.ink,
elevation: 0,
centerTitle: true,
title: const TitlePill('내 위치 알리기'),
),
body: _controller.isLoading
? const Center(child: CircularProgressIndicator())
: RefreshIndicator(
onRefresh: _controller.fetchReceivedCalls,
child: ListView(
padding: const EdgeInsets.all(16),
padding: const EdgeInsets.fromLTRB(16, 0, 16, 16),
children: [
const Center(child: TitlePill('내 위치 알리기')),
const SizedBox(height: 16),
Container(
padding: const EdgeInsets.all(14),
width: double.infinity,
padding: const EdgeInsets.symmetric(vertical: 18),
decoration: BoxDecoration(
color: const Color(0xFFEFF6FF),
borderRadius: BorderRadius.circular(14),
color: AppPalette.ink,
borderRadius: BorderRadius.circular(24),
),
child: Row(
child: Column(
children: [
const Text(
'현재 위치',
style: TextStyle(fontWeight: FontWeight.bold),
style: TextStyle(
color: Colors.white70,
fontSize: 12,
),
),
const Spacer(),
const SizedBox(height: 6),
Text(
'${kLocationIcons[_controller.currentLocation] ?? '📍'} ${_controller.currentLocation}',
style: const TextStyle(
fontWeight: FontWeight.bold,
color: AppPalette.ink,
fontSize: 20,
color: Colors.white,
),
),
],
),
),
const SizedBox(height: 20),
const Text(
'위치 선택',
style: TextStyle(fontWeight: FontWeight.bold),
),
const SizedBox(height: 8),
_sectionHeader('위치 선택'),
const SizedBox(height: 10),
GridView.builder(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
gridDelegate:
const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
childAspectRatio: 1.3,
crossAxisSpacing: 10,
mainAxisSpacing: 10,
const SliverGridDelegateWithMaxCrossAxisExtent(
maxCrossAxisExtent: 160,
mainAxisSpacing: 12,
crossAxisSpacing: 12,
mainAxisExtent: 90,
),
itemCount: kLocationOptions.length,
itemBuilder: (context, index) {
@@ -115,22 +149,40 @@ class _TeacherLocationScreenState extends State<TeacherLocationScreen> {
color: isSelected
? AppPalette.ink
: AppPalette.paper,
borderRadius: BorderRadius.circular(12),
borderRadius: BorderRadius.circular(20),
border: Border.all(
color: isSelected
? AppPalette.ink
: AppPalette.sage,
),
boxShadow: [
BoxShadow(
color: Colors.black.withValues(alpha: 0.03),
blurRadius: 12,
offset: const Offset(0, 4),
),
],
),
child: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Text(
kLocationIcons[loc] ?? '📍',
style: const TextStyle(fontSize: 20),
Container(
padding: const EdgeInsets.all(6),
decoration: BoxDecoration(
color: isSelected
? Colors.white.withValues(
alpha: 0.15,
)
: AppPalette.linen,
shape: BoxShape.circle,
),
child: Text(
kLocationIcons[loc] ?? '📍',
style: const TextStyle(fontSize: 16),
),
),
const SizedBox(height: 4),
const SizedBox(height: 6),
Text(
loc,
style: TextStyle(
@@ -149,11 +201,11 @@ class _TeacherLocationScreenState extends State<TeacherLocationScreen> {
},
),
const SizedBox(height: 24),
const Text(
_sectionHeader(
'나를 찾은 학생 기록',
style: TextStyle(fontWeight: FontWeight.bold),
count: _controller.receivedCalls.length,
),
const SizedBox(height: 8),
const SizedBox(height: 10),
_buildReceivedCalls(),
],
),
@@ -175,19 +227,33 @@ class _TeacherLocationScreenState extends State<TeacherLocationScreen> {
for (final c in _controller.receivedCalls)
Container(
margin: const EdgeInsets.only(bottom: 8),
padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 10),
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
decoration: BoxDecoration(
color: AppPalette.paper,
borderRadius: BorderRadius.circular(12),
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.notifications_active_rounded,
size: 16,
color: AppPalette.ink,
),
),
const SizedBox(width: 10),
Expanded(
child: Text('${c['studentName']} 학생 · ${c['purpose']}'),
),
Text(
'${c['createdAt'] ?? ''}',
style: const TextStyle(color: Colors.grey, fontSize: 11),
style: TextStyle(color: Colors.grey[500], fontSize: 11),
),
],
),