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