Skip to content

Commit 63fa5fb

Browse files
committed
fix(sheet): tint station mini-map sheet header with AppBar theme
The mini-map sheet's custom header was a Padding+Row sitting on the action sheet's light surface, so it read out of place next to every viewer-sheet body which inherits the brandDeep AppBar tint. Replace the custom header with a real AppBar widget so it picks up AppBarTheme automatically: brandDeep background, white foreground, elevation. StationCodeBadge goes in the leading slot, station name + exercise name go in a two-line title Column. The redundant Divider under the header is dropped since AppBar provides its own separation. Files: lib/views/widgets/station_mini_map.dart
1 parent a4422ee commit 63fa5fb

1 file changed

Lines changed: 36 additions & 30 deletions

File tree

lib/views/widgets/station_mini_map.dart

Lines changed: 36 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ Future<void> openStationMapSheet(
9090
mainAxisSize: MainAxisSize.max,
9191
children: [
9292
_MapSheetHeader(station: station, exercise: exercise),
93-
const Divider(height: 1),
9493
Expanded(
9594
child: MapView(
9695
layers: MapConfig.layers,
@@ -122,12 +121,15 @@ Future<void> openStationMapSheet(
122121
);
123122
}
124123

125-
class _MapSheetHeader extends StatelessWidget {
124+
class _MapSheetHeader extends StatelessWidget implements PreferredSizeWidget {
126125
const _MapSheetHeader({required this.station, required this.exercise});
127126

128127
final Station station;
129128
final Exercise exercise;
130129

130+
@override
131+
Size get preferredSize => const Size.fromHeight(72);
132+
131133
@override
132134
Widget build(BuildContext context) {
133135
final theme = Theme.of(context);
@@ -147,36 +149,40 @@ class _MapSheetHeader extends StatelessWidget {
147149
final hasRoles = service.loadRolePlays().any(
148150
(r) => r.exerciseUuid == exercise.uuid && r.stationIndex == station.index,
149151
);
150-
return Padding(
151-
padding: const EdgeInsets.fromLTRB(16, 0, 16, 8),
152-
child: Row(
152+
// Use a real AppBar so the header picks up `AppBarTheme` (brandDeep
153+
// background, white foreground, elevation) and reads identically to
154+
// the AppBar atop every viewer-sheet body in the app — the bar that
155+
// sits inside StationExerciseScreen, RolePlayScreen and so on. The
156+
// custom Padding/Row this replaced inherited the action sheet's
157+
// light surface color and looked out of place.
158+
final fg = theme.appBarTheme.foregroundColor ?? theme.colorScheme.onPrimary;
159+
return AppBar(
160+
automaticallyImplyLeading: false,
161+
toolbarHeight: 72,
162+
leadingWidth: 64,
163+
leading: Padding(
164+
padding: const EdgeInsets.only(left: 16),
165+
child: Center(
166+
child: StationCodeBadge(code: code, hasRoles: hasRoles),
167+
),
168+
),
169+
title: Column(
170+
crossAxisAlignment: CrossAxisAlignment.start,
171+
mainAxisSize: MainAxisSize.min,
153172
children: [
154-
StationCodeBadge(code: code, hasRoles: hasRoles),
155-
const SizedBox(width: 12),
156-
Expanded(
157-
child: Column(
158-
crossAxisAlignment: CrossAxisAlignment.start,
159-
mainAxisSize: MainAxisSize.min,
160-
children: [
161-
Text(
162-
station.name,
163-
style: theme.textTheme.titleLarge?.copyWith(
164-
fontWeight: FontWeight.w600,
165-
),
166-
maxLines: 1,
167-
overflow: TextOverflow.ellipsis,
168-
),
169-
const SizedBox(height: 2),
170-
Text(
171-
exercise.name,
172-
style: theme.textTheme.bodySmall?.copyWith(
173-
color: theme.colorScheme.onSurfaceVariant,
174-
),
175-
maxLines: 1,
176-
overflow: TextOverflow.ellipsis,
177-
),
178-
],
173+
Text(
174+
station.name,
175+
maxLines: 1,
176+
overflow: TextOverflow.ellipsis,
177+
),
178+
const SizedBox(height: 2),
179+
Text(
180+
exercise.name,
181+
style: theme.textTheme.bodySmall?.copyWith(
182+
color: fg.withValues(alpha: 0.75),
179183
),
184+
maxLines: 1,
185+
overflow: TextOverflow.ellipsis,
180186
),
181187
],
182188
),

0 commit comments

Comments
 (0)