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