From 83cb4a530061bb00004faef544e2e8217a357461 Mon Sep 17 00:00:00 2001 From: sihoo Date: Tue, 1 Sep 2026 08:43:20 +0900 Subject: [PATCH] =?UTF-8?q?=ED=95=99=EC=83=9D=20=EA=B3=84=EC=A0=95=20?= =?UTF-8?q?=EA=B0=9C=EB=B3=84=20=EC=B6=94=EA=B0=80:=20=EA=B8=B0=EB=B3=B8?= =?UTF-8?q?=20=EB=B9=84=EB=B0=80=EB=B2=88=ED=98=B8=201234=EB=A1=9C=20?= =?UTF-8?q?=EA=B3=A0=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 엑셀 일괄 등록과 동일하게 초기 비밀번호를 항상 1234로 고정하고 입력칸을 없앰. 대신 폼에 "초기 비밀번호: 1234 (고정)" 안내 표시. Co-Authored-By: Claude Sonnet 5 --- lib/ui/teacher_student_management_page.dart | 27 ++++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/lib/ui/teacher_student_management_page.dart b/lib/ui/teacher_student_management_page.dart index 5be9c0e..f0e68c0 100644 --- a/lib/ui/teacher_student_management_page.dart +++ b/lib/ui/teacher_student_management_page.dart @@ -27,7 +27,6 @@ class _TeacherStudentManagementPageState TeacherStudentManagementController(); final TextEditingController _addIdController = TextEditingController(); final TextEditingController _addNameController = TextEditingController(); - final TextEditingController _addPwController = TextEditingController(); int? _selectedGrade; bool _isDragging = false; @@ -42,17 +41,15 @@ class _TeacherStudentManagementPageState _controller.dispose(); _addIdController.dispose(); _addNameController.dispose(); - _addPwController.dispose(); super.dispose(); } - // ➕ [학생 추가 버튼 동작] + // ➕ [학생 추가 버튼 동작] 기본 비밀번호는 항상 1234로 고정. Future _addStudentAccount() async { final sId = _addIdController.text.trim(); final sName = _addNameController.text.trim(); - final sPw = _addPwController.text.trim(); - if (sId.isEmpty || sName.isEmpty || sPw.isEmpty) { + if (sId.isEmpty || sName.isEmpty) { ScaffoldMessenger.of( context, ).showSnackBar(const SnackBar(content: Text('⚠️ 모든 입력란을 채워주세요.'))); @@ -62,14 +59,13 @@ class _TeacherStudentManagementPageState final (success, message) = await _controller.addStudentAccount( studentId: sId, name: sName, - password: sPw, + password: '1234', grade: _selectedGrade, ); if (!mounted) return; if (success) { _addIdController.clear(); _addNameController.clear(); - _addPwController.clear(); setState(() => _selectedGrade = null); } ScaffoldMessenger.of( @@ -430,11 +426,18 @@ class _TeacherStudentManagementPageState decoration: fieldDecoration('이름', Icons.person), ), const SizedBox(height: 4), - TextField( - controller: _addPwController, - obscureText: true, - style: const TextStyle(fontSize: 12), - decoration: fieldDecoration('초기 비밀번호', Icons.lock), + const Padding( + padding: EdgeInsets.symmetric(horizontal: 4), + child: Row( + children: [ + Icon(Icons.lock, size: 14, color: Colors.grey), + SizedBox(width: 6), + Text( + '초기 비밀번호: 1234 (고정)', + style: TextStyle(fontSize: 11, color: Colors.grey), + ), + ], + ), ), const SizedBox(height: 4), DropdownButtonFormField(