선생님 대시보드 웹 타일 그리드 반응형으로 수정
웹(넓은 화면)에서 항상 2개씩 줄바꿈되던 버그 수정. 학생 대시보드와 동일하게 LayoutBuilder로 폭이 800 이상이면 한 줄에 5개, 좁으면 기존처럼 2개씩 보이도록 함. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -136,62 +136,68 @@ class _TeacherDashboardState extends State<TeacherDashboard> {
|
|||||||
const SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
|
|
||||||
// 📊 [그리드 레이아웃 메뉴] 시후의 카드 컴포넌트 스타일 적용
|
// 📊 [그리드 레이아웃 메뉴] 시후의 카드 컴포넌트 스타일 적용
|
||||||
// 🖥️ 데스크톱 브라우저에서 카드가 지나치게 커지지 않도록 최대 너비를 제한한다.
|
LayoutBuilder(
|
||||||
Center(
|
builder: (context, constraints) {
|
||||||
child: ConstrainedBox(
|
// 🖥️ 웹(넓은 화면)은 한 줄에 5개씩, 폰(좁은 화면)은 기존 2개 그대로.
|
||||||
constraints: const BoxConstraints(maxWidth: 700),
|
final bool isWide = constraints.maxWidth >= 800;
|
||||||
child: Padding(
|
return Center(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 24.0),
|
child: ConstrainedBox(
|
||||||
child: GridView.count(
|
constraints: BoxConstraints(maxWidth: isWide ? 1300 : 700),
|
||||||
shrinkWrap: true,
|
child: Padding(
|
||||||
physics: const NeverScrollableScrollPhysics(),
|
padding: const EdgeInsets.symmetric(horizontal: 24.0),
|
||||||
crossAxisCount: 2,
|
child: GridView.count(
|
||||||
crossAxisSpacing: 16,
|
shrinkWrap: true,
|
||||||
mainAxisSpacing: 16,
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
childAspectRatio: 0.95,
|
crossAxisCount: isWide ? 5 : 2,
|
||||||
children: [
|
crossAxisSpacing: 16,
|
||||||
_buildModernCard(
|
mainAxisSpacing: 16,
|
||||||
icon: Icons.assignment_turned_in_rounded,
|
childAspectRatio: 0.95,
|
||||||
title: '실시간 출석 확인',
|
children: [
|
||||||
subtitle: '학생 제출 로그 모니터링',
|
_buildModernCard(
|
||||||
color: Colors.blue,
|
icon: Icons.assignment_turned_in_rounded,
|
||||||
onTap: () => Navigator.push(
|
title: '실시간 출석 확인',
|
||||||
context,
|
subtitle: '학생 제출 로그 모니터링',
|
||||||
MaterialPageRoute(
|
color: Colors.blue,
|
||||||
builder: (context) => const TeacherAttendancePage(),
|
onTap: () => Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (context) =>
|
||||||
|
const TeacherAttendancePage(),
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
_buildModernCard(
|
||||||
),
|
icon: Icons.manage_accounts_rounded,
|
||||||
_buildModernCard(
|
title: '학생 계정 관리',
|
||||||
icon: Icons.manage_accounts_rounded,
|
subtitle: '계정 추가 및 강제 리셋',
|
||||||
title: '학생 계정 관리',
|
color: Colors.orange,
|
||||||
subtitle: '계정 추가 및 강제 리셋',
|
onTap: () => Navigator.push(
|
||||||
color: Colors.orange,
|
context,
|
||||||
onTap: () => Navigator.push(
|
MaterialPageRoute(
|
||||||
context,
|
builder: (context) =>
|
||||||
MaterialPageRoute(
|
const TeacherStudentManagementPage(),
|
||||||
builder: (context) =>
|
),
|
||||||
const TeacherStudentManagementPage(),
|
),
|
||||||
),
|
),
|
||||||
),
|
_buildModernCard(
|
||||||
),
|
icon: Icons.tablet_mac_rounded,
|
||||||
_buildModernCard(
|
title: '스마트기기 반출 대장',
|
||||||
icon: Icons.tablet_mac_rounded,
|
subtitle: '패드 반출 신청 승인/거절',
|
||||||
title: '스마트기기 반출 대장',
|
color: Colors.teal,
|
||||||
subtitle: '패드 반출 신청 승인/거절',
|
onTap: () => Navigator.push(
|
||||||
color: Colors.teal,
|
context,
|
||||||
onTap: () => Navigator.push(
|
MaterialPageRoute(
|
||||||
context,
|
builder: (context) =>
|
||||||
MaterialPageRoute(
|
const DeviceCheckoutLedgerPage(),
|
||||||
builder: (context) =>
|
),
|
||||||
const DeviceCheckoutLedgerPage(),
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
);
|
||||||
),
|
},
|
||||||
),
|
),
|
||||||
const SizedBox(height: 32),
|
const SizedBox(height: 32),
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user