학생 계정 개별 추가: 기본 비밀번호 1234로 고정
엑셀 일괄 등록과 동일하게 초기 비밀번호를 항상 1234로 고정하고 입력칸을 없앰. 대신 폼에 "초기 비밀번호: 1234 (고정)" 안내 표시. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -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<void> _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<int>(
|
||||
|
||||
Reference in New Issue
Block a user