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),