From debf733afd7e47277ed964415096c23e46ac5e66 Mon Sep 17 00:00:00 2001 From: sihoo Date: Mon, 31 Aug 2026 19:52:49 +0900 Subject: [PATCH] =?UTF-8?q?=ED=95=99=EC=83=9D=20=EA=B3=84=EC=A0=95=20?= =?UTF-8?q?=EA=B4=80=EB=A6=AC=20-=20=EC=8B=A0=EA=B7=9C=20=EA=B3=84?= =?UTF-8?q?=EC=A0=95=20=EC=B6=94=EA=B0=80=20=ED=8F=BC=20=ED=8F=AD=20?= =?UTF-8?q?=EC=B6=95=EC=86=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 웹 넓은 화면에서 계정 추가 폼이 페이지 전체 폭으로 늘어나 지나치게 길어 보이던 문제 수정. 현재 폭의 2/3로 제한. Co-Authored-By: Claude Sonnet 5 --- lib/ui/teacher_student_management_page.dart | 166 +++++++++++--------- 1 file changed, 88 insertions(+), 78 deletions(-) diff --git a/lib/ui/teacher_student_management_page.dart b/lib/ui/teacher_student_management_page.dart index bccdd5f..9ae1e2a 100644 --- a/lib/ui/teacher_student_management_page.dart +++ b/lib/ui/teacher_student_management_page.dart @@ -417,90 +417,100 @@ class _TeacherStudentManagementPageState const SizedBox(height: 16), // 📝 학생 추가 컨테이너 폼 - Container( - padding: const EdgeInsets.all(20), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(24), - boxShadow: [ - BoxShadow( - color: Colors.black.withValues(alpha: 0.04), - blurRadius: 16, + // 🖥️ 웹 넓은 화면에서 폼이 지나치게 길어지지 않도록 현재 폭의 2/3로 제한한다. + LayoutBuilder( + builder: (context, constraints) { + return ConstrainedBox( + constraints: BoxConstraints( + maxWidth: constraints.maxWidth * 2 / 3, ), - ], - ), - child: Column( - children: [ - TextField( - controller: _addIdController, - keyboardType: TextInputType.number, - decoration: const InputDecoration( - labelText: '학번', - 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( - 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: Container( + padding: const EdgeInsets.all(20), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(24), + boxShadow: [ + BoxShadow( + color: Colors.black.withValues(alpha: 0.04), + blurRadius: 16, ), - ), - child: _controller.isWorking - ? const CircularProgressIndicator( - color: Colors.white, - ) - : const Text( - '학생 등록 완료', - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 15, + ], + ), + child: Column( + children: [ + TextField( + controller: _addIdController, + keyboardType: TextInputType.number, + decoration: const InputDecoration( + labelText: '학번', + 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( + 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),