계정 추가 폼이 작은 박스 안에서도 버튼까지 다 보이도록 조정
박스 크기를 살짝 키우고(25% 크기 기준 +45%) 입력 필드를 촘촘하게 (isDense, 작은 폰트/패딩) 만들어 스크롤 없이 등록 버튼까지 모두 보이도록 함. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -397,10 +397,12 @@ class _TeacherStudentManagementPageState
|
||||
);
|
||||
}
|
||||
|
||||
// 📝 [정사각형 박스 1] 신규 학생 계정 추가 폼.
|
||||
// 📝 [정사각형 박스 1] 신규 학생 계정 추가 폼. 박스가 작아도 버튼까지 다 보이도록 촘촘하게 배치.
|
||||
Widget _buildAddAccountBox() {
|
||||
const InputDecoration Function(String, IconData) fieldDecoration =
|
||||
_compactFieldDecoration;
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(20),
|
||||
padding: const EdgeInsets.all(10),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(24),
|
||||
@@ -418,35 +420,27 @@ class _TeacherStudentManagementPageState
|
||||
TextField(
|
||||
controller: _addIdController,
|
||||
keyboardType: TextInputType.number,
|
||||
decoration: const InputDecoration(
|
||||
labelText: '학번',
|
||||
prefixIcon: Icon(Icons.badge),
|
||||
style: const TextStyle(fontSize: 12),
|
||||
decoration: fieldDecoration('학번', Icons.badge),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
const SizedBox(height: 4),
|
||||
TextField(
|
||||
controller: _addNameController,
|
||||
decoration: const InputDecoration(
|
||||
labelText: '이름',
|
||||
prefixIcon: Icon(Icons.person),
|
||||
style: const TextStyle(fontSize: 12),
|
||||
decoration: fieldDecoration('이름', Icons.person),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
const SizedBox(height: 4),
|
||||
TextField(
|
||||
controller: _addPwController,
|
||||
obscureText: true,
|
||||
decoration: const InputDecoration(
|
||||
labelText: '초기 비밀번호',
|
||||
prefixIcon: Icon(Icons.lock),
|
||||
style: const TextStyle(fontSize: 12),
|
||||
decoration: fieldDecoration('초기 비밀번호', Icons.lock),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
const SizedBox(height: 4),
|
||||
DropdownButtonFormField<int>(
|
||||
initialValue: _selectedGrade,
|
||||
decoration: const InputDecoration(
|
||||
labelText: '학년 (선택)',
|
||||
prefixIcon: Icon(Icons.class_),
|
||||
),
|
||||
style: const TextStyle(fontSize: 12, color: Colors.black87),
|
||||
decoration: fieldDecoration('학년 (선택)', Icons.class_),
|
||||
items: const [
|
||||
DropdownMenuItem(value: 1, child: Text('1학년')),
|
||||
DropdownMenuItem(value: 2, child: Text('2학년')),
|
||||
@@ -454,26 +448,34 @@ class _TeacherStudentManagementPageState
|
||||
],
|
||||
onChanged: (value) => setState(() => _selectedGrade = value),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
const SizedBox(height: 6),
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
height: 50,
|
||||
height: 30,
|
||||
child: ElevatedButton(
|
||||
onPressed: _controller.isWorking ? null : _addStudentAccount,
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Colors.orange,
|
||||
foregroundColor: Colors.white,
|
||||
padding: EdgeInsets.zero,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
),
|
||||
child: _controller.isWorking
|
||||
? const CircularProgressIndicator(color: Colors.white)
|
||||
? const SizedBox(
|
||||
width: 16,
|
||||
height: 16,
|
||||
child: CircularProgressIndicator(
|
||||
color: Colors.white,
|
||||
strokeWidth: 2,
|
||||
),
|
||||
)
|
||||
: const Text(
|
||||
'학생 등록 완료',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 15,
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -484,6 +486,16 @@ class _TeacherStudentManagementPageState
|
||||
);
|
||||
}
|
||||
|
||||
static InputDecoration _compactFieldDecoration(String label, IconData icon) {
|
||||
return InputDecoration(
|
||||
labelText: label,
|
||||
labelStyle: const TextStyle(fontSize: 12),
|
||||
prefixIcon: Icon(icon, size: 16),
|
||||
isDense: true,
|
||||
contentPadding: const EdgeInsets.symmetric(vertical: 4, horizontal: 8),
|
||||
);
|
||||
}
|
||||
|
||||
// 📤 [정사각형 박스 2] 엑셀 일괄 등록 드롭존.
|
||||
Widget _buildExcelBox() {
|
||||
return DropTarget(
|
||||
@@ -673,9 +685,9 @@ class _TeacherStudentManagementPageState
|
||||
// 📐 학생 목록 타일은 "실시간 출석 확인" 목록의 타일(220x148)과 동일하게 맞춘다.
|
||||
final bool isWide = constraints.maxWidth >= 800;
|
||||
final double listWidth = constraints.maxWidth;
|
||||
// 📉 계정 추가 / 엑셀 등록 칸: 정사각형 기본 크기의 25%로 축소.
|
||||
// 📉 계정 추가 / 엑셀 등록 칸: 정사각형 기본 크기의 25%(+ 버튼까지 다 보이도록 확대).
|
||||
final double formSquareSize =
|
||||
((constraints.maxWidth - 20) / 2) * 0.25;
|
||||
((constraints.maxWidth - 20) / 2) * 0.25 * 1.45;
|
||||
|
||||
final Widget addBoxColumn = Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
|
||||
Reference in New Issue
Block a user