앱 전체 알림을 알약형(AppNotice)으로 통일
나머지 화면들(교사 회원가입, 학생 계정 관리, 관리자 대시보드, 스마트기기 반출 신청/대장, NFC 태그 쓰기/체크인, 비밀번호 변경)에 남아있던 예전 ScaffoldMessenger.showSnackBar를 전부 AppNotice로 교체. - AppNotice.show에 선택적 color 파라미터 추가 - NFC 태그 쓰기/체크인 화면처럼 성공(초록)/실패(빨강) 등 색으로 구분하던 알림은 그 색을 그대로 유지하면서 모양/위치만 통일된 알약 스타일로 바뀜 - 알림 직후 화면을 전환(로그인 성공 후 대시보드 이동, 회원가입 성공 후 로그인 화면 복귀 등)하던 곳들도, AppNotice가 화면(Scaffold)이 아니라 전역 Overlay를 쓰기 때문에 전환 중에 알림이 잘리지 않고 새 화면 위에 계속 보임 (기존 스낵바 방식보다 개선됨) Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import '../function/teacher_register_controller.dart';
|
||||
import '../theme/app_palette.dart';
|
||||
import 'app_notice.dart';
|
||||
|
||||
class TeacherRegisterScreen extends StatefulWidget {
|
||||
const TeacherRegisterScreen({super.key});
|
||||
@@ -35,9 +36,7 @@ class _TeacherRegisterScreenState extends State<TeacherRegisterScreen> {
|
||||
String secret = _secretController.text.trim();
|
||||
|
||||
if (id.isEmpty || pw.isEmpty || name.isEmpty || secret.isEmpty) {
|
||||
ScaffoldMessenger.of(
|
||||
context,
|
||||
).showSnackBar(const SnackBar(content: Text('모든 빈칸을 입력해 주세요.')));
|
||||
AppNotice.show(context, '모든 빈칸을 입력해 주세요.');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -48,9 +47,7 @@ class _TeacherRegisterScreenState extends State<TeacherRegisterScreen> {
|
||||
secretCode: secret,
|
||||
);
|
||||
if (!mounted) return;
|
||||
ScaffoldMessenger.of(
|
||||
context,
|
||||
).showSnackBar(SnackBar(content: Text(message)));
|
||||
AppNotice.show(context, message);
|
||||
if (success) {
|
||||
Navigator.pop(context); // 가입 성공 시 로그인 화면으로 복귀
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user