From eccd55c2018e4f60500c9a1cd7292a554507a6db Mon Sep 17 00:00:00 2001 From: sihoo Date: Mon, 31 Aug 2026 19:46:19 +0900 Subject: [PATCH] =?UTF-8?q?=EC=84=A0=EC=83=9D=EB=8B=98=20=EB=8C=80?= =?UTF-8?q?=EC=8B=9C=EB=B3=B4=EB=93=9C=20=EC=9B=B9=20=ED=83=80=EC=9D=BC=20?= =?UTF-8?q?=EA=B7=B8=EB=A6=AC=EB=93=9C=20=EB=B0=98=EC=9D=91=ED=98=95?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 웹(넓은 화면)에서 항상 2개씩 줄바꿈되던 버그 수정. 학생 대시보드와 동일하게 LayoutBuilder로 폭이 800 이상이면 한 줄에 5개, 좁으면 기존처럼 2개씩 보이도록 함. Co-Authored-By: Claude Sonnet 5 --- lib/ui/teacher_dashboard.dart | 108 ++++++++++++++++++---------------- 1 file changed, 57 insertions(+), 51 deletions(-) diff --git a/lib/ui/teacher_dashboard.dart b/lib/ui/teacher_dashboard.dart index 5223903..7cc97be 100644 --- a/lib/ui/teacher_dashboard.dart +++ b/lib/ui/teacher_dashboard.dart @@ -136,62 +136,68 @@ class _TeacherDashboardState extends State { const SizedBox(height: 16), // 📊 [그리드 레이아웃 메뉴] 시후의 카드 컴포넌트 스타일 적용 - // 🖥️ 데스크톱 브라우저에서 카드가 지나치게 커지지 않도록 최대 너비를 제한한다. - Center( - child: ConstrainedBox( - constraints: const BoxConstraints(maxWidth: 700), - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 24.0), - child: GridView.count( - shrinkWrap: true, - physics: const NeverScrollableScrollPhysics(), - crossAxisCount: 2, - crossAxisSpacing: 16, - mainAxisSpacing: 16, - childAspectRatio: 0.95, - children: [ - _buildModernCard( - icon: Icons.assignment_turned_in_rounded, - title: '실시간 출석 확인', - subtitle: '학생 제출 로그 모니터링', - color: Colors.blue, - onTap: () => Navigator.push( - context, - MaterialPageRoute( - builder: (context) => const TeacherAttendancePage(), + LayoutBuilder( + builder: (context, constraints) { + // 🖥️ 웹(넓은 화면)은 한 줄에 5개씩, 폰(좁은 화면)은 기존 2개 그대로. + final bool isWide = constraints.maxWidth >= 800; + return Center( + child: ConstrainedBox( + constraints: BoxConstraints(maxWidth: isWide ? 1300 : 700), + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 24.0), + child: GridView.count( + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + crossAxisCount: isWide ? 5 : 2, + crossAxisSpacing: 16, + mainAxisSpacing: 16, + childAspectRatio: 0.95, + children: [ + _buildModernCard( + icon: Icons.assignment_turned_in_rounded, + title: '실시간 출석 확인', + subtitle: '학생 제출 로그 모니터링', + color: Colors.blue, + onTap: () => Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + const TeacherAttendancePage(), + ), + ), ), - ), - ), - _buildModernCard( - icon: Icons.manage_accounts_rounded, - title: '학생 계정 관리', - subtitle: '계정 추가 및 강제 리셋', - color: Colors.orange, - onTap: () => Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - const TeacherStudentManagementPage(), + _buildModernCard( + icon: Icons.manage_accounts_rounded, + title: '학생 계정 관리', + subtitle: '계정 추가 및 강제 리셋', + color: Colors.orange, + onTap: () => Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + const TeacherStudentManagementPage(), + ), + ), ), - ), - ), - _buildModernCard( - icon: Icons.tablet_mac_rounded, - title: '스마트기기 반출 대장', - subtitle: '패드 반출 신청 승인/거절', - color: Colors.teal, - onTap: () => Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - const DeviceCheckoutLedgerPage(), + _buildModernCard( + icon: Icons.tablet_mac_rounded, + title: '스마트기기 반출 대장', + subtitle: '패드 반출 신청 승인/거절', + color: Colors.teal, + onTap: () => Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + const DeviceCheckoutLedgerPage(), + ), + ), ), - ), + ], ), - ], + ), ), - ), - ), + ); + }, ), const SizedBox(height: 32), ],