Skip to content

Commit cd1c46f

Browse files
refactor: improve layout responsiveness in overview screen and enhance theme separation with updated card and scaffold colors
1 parent 60c1df4 commit cd1c46f

2 files changed

Lines changed: 18 additions & 9 deletions

File tree

dashboard/lib/screens/overview_screen.dart

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -623,11 +623,17 @@ class _StatsStrip extends StatelessWidget {
623623
),
624624
];
625625

626-
// Aim for 3 + 2 on typical widths.
627-
final itemWidth = c.maxWidth >= 900 ? 210.0 : 180.0;
626+
// Aim for 3 + 2 when space allows by computing width from constraints.
627+
// This avoids the common 4 + 1 wrap that happens with a fixed tile width.
628+
const gap = 14.0;
629+
const minTileWidth = 180.0;
630+
final canDoThree =
631+
(c.maxWidth - (gap * 2)) / 3 >= minTileWidth; // 3 columns
632+
final cols = canDoThree ? 3 : 2;
633+
final itemWidth = (c.maxWidth - (gap * (cols - 1))) / cols;
628634
return Wrap(
629-
spacing: 14,
630-
runSpacing: 14,
635+
spacing: gap,
636+
runSpacing: gap,
631637
children: [
632638
for (final t in tiles) SizedBox(width: itemWidth, child: t),
633639
],

dashboard/lib/theme/app_theme.dart

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,10 @@ class AppTheme {
8888
displayColor: darkTextPrimary,
8989
),
9090
cardTheme: CardThemeData(
91-
color: darkSurface,
92-
elevation: 1,
91+
// Slightly brighter than scaffold for clearer separation.
92+
color: darkSurfaceLight,
93+
elevation: 2,
94+
shadowColor: Colors.black.withValues(alpha: 0.35),
9395
margin: EdgeInsets.zero,
9496
shape: RoundedRectangleBorder(
9597
borderRadius: BorderRadius.circular(12),
@@ -123,7 +125,8 @@ class AppTheme {
123125
return ThemeData(
124126
useMaterial3: true,
125127
brightness: Brightness.light,
126-
scaffoldBackgroundColor: lightBackground,
128+
// Slightly darker than card surface for clear separation.
129+
scaffoldBackgroundColor: const Color(0xFFF3F6FB),
127130
colorScheme: const ColorScheme.light(
128131
surface: lightSurface,
129132
primary: primary,
@@ -136,8 +139,8 @@ class AppTheme {
136139
),
137140
cardTheme: CardThemeData(
138141
color: lightSurface,
139-
elevation: 1,
140-
shadowColor: Colors.black.withValues(alpha: 0.08),
142+
elevation: 2,
143+
shadowColor: Colors.black.withValues(alpha: 0.06),
141144
margin: EdgeInsets.zero,
142145
shape: RoundedRectangleBorder(
143146
borderRadius: BorderRadius.circular(12),

0 commit comments

Comments
 (0)