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(