- TitlePill을 String 기반으로 바꿔서 모든 화면(설정/교사 회원가입/관리자 시스템/NFC 태그 쓰기·체크인/학생 관리/스마트기기 반출 신청·대장/실시간 출석 현황)이 완전히 같은 폰트(굵게, 15px, 흰색)를 쓰게 통일 - 알약이 화면 맨 위에 딱 붙어 보이지 않도록 위쪽에 8px 여백 추가 - "스마트기기 반출 신청" 폼과 "관리자 시스템"의 "모든 출석 데이터 초기화" 버튼이 넓은 화면에서 양옆으로 과하게 늘어지던 문제 수정 - 최대 폭 420px로 제한하고 가운데 정렬 (기존 대비 약 1/3 크기) - 메인 대시보드 타일 목표 크기를 184 → 276(50% 확대)로 키우고, 아이콘/ 패딩/폰트 기준값도 함께 올려서 제목 10→12pt, 부제 8→10pt로 확대 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
144 lines
5.0 KiB
Dart
144 lines
5.0 KiB
Dart
// 👨🏫 교사 회원가입 화면 (UI 전용). 서버 통신/상태는
|
|
// lib/function/teacher_register_controller.dart가 담당한다.
|
|
import 'package:flutter/material.dart';
|
|
import '../function/teacher_register_controller.dart';
|
|
import '../theme/app_palette.dart';
|
|
import 'app_notice.dart';
|
|
import 'title_pill.dart';
|
|
|
|
class TeacherRegisterScreen extends StatefulWidget {
|
|
const TeacherRegisterScreen({super.key});
|
|
|
|
@override
|
|
State<TeacherRegisterScreen> createState() => _TeacherRegisterScreenState();
|
|
}
|
|
|
|
class _TeacherRegisterScreenState extends State<TeacherRegisterScreen> {
|
|
final TeacherRegisterController _controller = TeacherRegisterController();
|
|
final _idController = TextEditingController();
|
|
final _pwController = TextEditingController();
|
|
final _nameController = TextEditingController();
|
|
final _secretController = TextEditingController();
|
|
|
|
@override
|
|
void dispose() {
|
|
_controller.dispose();
|
|
_idController.dispose();
|
|
_pwController.dispose();
|
|
_nameController.dispose();
|
|
_secretController.dispose();
|
|
super.dispose();
|
|
}
|
|
|
|
Future<void> _registerTeacher() async {
|
|
String id = _idController.text.trim();
|
|
String pw = _pwController.text.trim();
|
|
String name = _nameController.text.trim();
|
|
String secret = _secretController.text.trim();
|
|
|
|
if (id.isEmpty || pw.isEmpty || name.isEmpty || secret.isEmpty) {
|
|
AppNotice.show(context, '모든 빈칸을 입력해 주세요.');
|
|
return;
|
|
}
|
|
|
|
final (success, message) = await _controller.registerTeacher(
|
|
id: id,
|
|
password: pw,
|
|
name: name,
|
|
secretCode: secret,
|
|
);
|
|
if (!mounted) return;
|
|
AppNotice.show(context, message);
|
|
if (success) {
|
|
Navigator.pop(context); // 가입 성공 시 로그인 화면으로 복귀
|
|
}
|
|
}
|
|
|
|
@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,
|
|
centerTitle: true,
|
|
title: const TitlePill('교사 회원가입'),
|
|
),
|
|
body: SingleChildScrollView(
|
|
padding: const EdgeInsets.all(24.0),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
const Text(
|
|
'교직원 전용 인증',
|
|
style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
|
|
),
|
|
const SizedBox(height: 4),
|
|
const Text(
|
|
'학교에서 발급한 교사 가입 비밀코드가 필요합니다.',
|
|
style: TextStyle(color: Colors.grey),
|
|
),
|
|
const SizedBox(height: 24),
|
|
TextField(
|
|
controller: _secretController,
|
|
obscureText: true,
|
|
decoration: const InputDecoration(
|
|
labelText: '교사 인증 비밀코드 입력',
|
|
border: OutlineInputBorder(),
|
|
),
|
|
),
|
|
const SizedBox(height: 16),
|
|
const Divider(),
|
|
const SizedBox(height: 16),
|
|
TextField(
|
|
controller: _idController,
|
|
decoration: const InputDecoration(
|
|
labelText: '교직원 번호 (ID로 사용)',
|
|
border: OutlineInputBorder(),
|
|
),
|
|
),
|
|
const SizedBox(height: 12),
|
|
TextField(
|
|
controller: _nameController,
|
|
decoration: const InputDecoration(
|
|
labelText: '선생님 성함',
|
|
border: OutlineInputBorder(),
|
|
),
|
|
),
|
|
const SizedBox(height: 12),
|
|
TextField(
|
|
controller: _pwController,
|
|
obscureText: true,
|
|
decoration: const InputDecoration(
|
|
labelText: '사용할 비밀번호 입력',
|
|
border: OutlineInputBorder(),
|
|
),
|
|
),
|
|
const SizedBox(height: 24),
|
|
SizedBox(
|
|
width: double.infinity,
|
|
height: 50,
|
|
child: ElevatedButton(
|
|
style: ElevatedButton.styleFrom(
|
|
backgroundColor: AppPalette.ink,
|
|
foregroundColor: AppPalette.paper,
|
|
),
|
|
onPressed: _controller.isLoading ? null : _registerTeacher,
|
|
child: _controller.isLoading
|
|
? const CircularProgressIndicator(color: Colors.white)
|
|
: const Text('교사 계정 생성하기'),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
},
|
|
);
|
|
}
|
|
}
|