diff --git a/lib/ui/main_dashboard.dart b/lib/ui/main_dashboard.dart index c45b618..fbe8c9a 100644 --- a/lib/ui/main_dashboard.dart +++ b/lib/ui/main_dashboard.dart @@ -629,28 +629,39 @@ class _MainDashboardState extends State { child: LayoutBuilder( builder: (context, constraints) { final double width = constraints.maxWidth; + // ๐Ÿ”ฒ ์ •์‚ฌ๊ฐํ˜• 1์นธ ๊ธฐ์ค€ 4ร—3 ๋ฐฐ์น˜ โ€” ํ™”๋ฉด์ด ๋„“์–ด๋„ 6์นธ๊นŒ์ง€ ๋Š˜๋ฆฌ์ง€ ์•Š๊ณ  4์นธ์—์„œ ๋ฉˆ์ถ˜๋‹ค. final int crossAxisCount = width < 420 ? 2 : width < 700 ? 3 - : width < 1000 - ? 4 - : 6; + : 4; + // ๐Ÿ“ ์บ”๋ฒ„์Šค ์ž์ฒด๋ฅผ 700px์—์„œ ๋” ๋„“์–ด์ง€์ง€ ์•Š๊ฒŒ ๋ง‰๊ณ , ํƒ€์ผ ํฌ๊ธฐ๋ฅผ ์ „์ฒด์ ์œผ๋กœ + // 20% ์ค„์—ฌ์„œ ํ™”๋ฉด์ด ๊ฝ‰ ์ฐจ ๋ณด์ด์ง€ ์•Š๊ณ  ์—ฌ๋ฐฑ์ด ์ƒ๊ธฐ๊ฒŒ ํ•œ๋‹ค. + const double maxGridWidth = 700; + final double cappedWidth = width < maxGridWidth + ? width + : maxGridWidth; + final double gridWidth = cappedWidth * 0.8; - return StaggeredGrid.count( - crossAxisCount: crossAxisCount, - mainAxisSpacing: 12, - crossAxisSpacing: 12, - children: [ - for (final tile in tiles) - StaggeredGridTile.count( - crossAxisCellCount: _spanFor( - tile.id, - ).$1.clamp(1, crossAxisCount), - mainAxisCellCount: _spanFor(tile.id).$2, - child: tile.child, - ), - ], + return Center( + child: SizedBox( + width: gridWidth, + child: StaggeredGrid.count( + crossAxisCount: crossAxisCount, + mainAxisSpacing: 12, + crossAxisSpacing: 12, + children: [ + for (final tile in tiles) + StaggeredGridTile.count( + crossAxisCellCount: _spanFor( + tile.id, + ).$1.clamp(1, crossAxisCount), + mainAxisCellCount: _spanFor(tile.id).$2, + child: tile.child, + ), + ], + ), + ), ); }, ),