학생 계정 관리 - 신규 계정 추가 폼 폭 축소

웹 넓은 화면에서 계정 추가 폼이 페이지 전체 폭으로 늘어나
지나치게 길어 보이던 문제 수정. 현재 폭의 2/3로 제한.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-31 19:52:49 +09:00
co-authored by Claude Sonnet 5
parent eccd55c201
commit debf733afd
+88 -78
View File
@@ -417,90 +417,100 @@ class _TeacherStudentManagementPageState
const SizedBox(height: 16), const SizedBox(height: 16),
// 📝 학생 추가 컨테이너 폼 // 📝 학생 추가 컨테이너 폼
Container( // 🖥️ 웹 넓은 화면에서 폼이 지나치게 길어지지 않도록 현재 폭의 2/3로 제한한다.
padding: const EdgeInsets.all(20), LayoutBuilder(
decoration: BoxDecoration( builder: (context, constraints) {
color: Colors.white, return ConstrainedBox(
borderRadius: BorderRadius.circular(24), constraints: BoxConstraints(
boxShadow: [ maxWidth: constraints.maxWidth * 2 / 3,
BoxShadow(
color: Colors.black.withValues(alpha: 0.04),
blurRadius: 16,
), ),
], child: Container(
), padding: const EdgeInsets.all(20),
child: Column( decoration: BoxDecoration(
children: [ color: Colors.white,
TextField( borderRadius: BorderRadius.circular(24),
controller: _addIdController, boxShadow: [
keyboardType: TextInputType.number, BoxShadow(
decoration: const InputDecoration( color: Colors.black.withValues(alpha: 0.04),
labelText: '학번', blurRadius: 16,
prefixIcon: Icon(Icons.badge),
),
),
const SizedBox(height: 12),
TextField(
controller: _addNameController,
decoration: const InputDecoration(
labelText: '이름',
prefixIcon: Icon(Icons.person),
),
),
const SizedBox(height: 12),
TextField(
controller: _addPwController,
obscureText: true,
decoration: const InputDecoration(
labelText: '초기 비밀번호',
prefixIcon: Icon(Icons.lock),
),
),
const SizedBox(height: 12),
DropdownButtonFormField<int>(
initialValue: _selectedGrade,
decoration: const InputDecoration(
labelText: '학년 (선택)',
prefixIcon: Icon(Icons.class_),
),
items: const [
DropdownMenuItem(value: 1, child: Text('1학년')),
DropdownMenuItem(value: 2, child: Text('2학년')),
DropdownMenuItem(value: 3, child: Text('3학년')),
],
onChanged: (value) =>
setState(() => _selectedGrade = value),
),
const SizedBox(height: 20),
SizedBox(
width: double.infinity,
height: 50,
child: ElevatedButton(
onPressed: _controller.isWorking
? null
: _addStudentAccount,
style: ElevatedButton.styleFrom(
backgroundColor: Colors.orange,
foregroundColor: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
), ),
), ],
child: _controller.isWorking ),
? const CircularProgressIndicator( child: Column(
color: Colors.white, children: [
) TextField(
: const Text( controller: _addIdController,
'학생 등록 완료', keyboardType: TextInputType.number,
style: TextStyle( decoration: const InputDecoration(
fontWeight: FontWeight.bold, labelText: '학번',
fontSize: 15, prefixIcon: Icon(Icons.badge),
),
),
const SizedBox(height: 12),
TextField(
controller: _addNameController,
decoration: const InputDecoration(
labelText: '이름',
prefixIcon: Icon(Icons.person),
),
),
const SizedBox(height: 12),
TextField(
controller: _addPwController,
obscureText: true,
decoration: const InputDecoration(
labelText: '초기 비밀번호',
prefixIcon: Icon(Icons.lock),
),
),
const SizedBox(height: 12),
DropdownButtonFormField<int>(
initialValue: _selectedGrade,
decoration: const InputDecoration(
labelText: '학년 (선택)',
prefixIcon: Icon(Icons.class_),
),
items: const [
DropdownMenuItem(value: 1, child: Text('1학년')),
DropdownMenuItem(value: 2, child: Text('2학년')),
DropdownMenuItem(value: 3, child: Text('3학년')),
],
onChanged: (value) =>
setState(() => _selectedGrade = value),
),
const SizedBox(height: 20),
SizedBox(
width: double.infinity,
height: 50,
child: ElevatedButton(
onPressed: _controller.isWorking
? null
: _addStudentAccount,
style: ElevatedButton.styleFrom(
backgroundColor: Colors.orange,
foregroundColor: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
), ),
), ),
child: _controller.isWorking
? const CircularProgressIndicator(
color: Colors.white,
)
: const Text(
'학생 등록 완료',
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 15,
),
),
),
),
],
), ),
), ),
], );
), },
), ),
const SizedBox(height: 36), const SizedBox(height: 36),