Skip to content

Commit e7b1718

Browse files
fix: wire SOS button, emergency overlay, message bar and banner into map screen
These widgets existed as complete implementations but were never added to the map screen's widget tree. Users could not see or interact with tactical messaging or emergency beacon features. Also fixed ConsumerState.build signature in sos_button.dart (extra WidgetRef param prevented compilation when imported). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 783e66c commit e7b1718

5 files changed

Lines changed: 41 additions & 15 deletions

File tree

android/settings.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pluginManagement {
2020
plugins {
2121
id("dev.flutter.flutter-plugin-loader") version "1.0.0"
2222
id("com.android.application") version "8.11.1" apply false
23-
id("org.jetbrains.kotlin.android") version "2.2.20" apply false
23+
id("org.jetbrains.kotlin.android") version "2.1.0" apply false
2424
}
2525

2626
include(":app")

lib/ui/screens/field_link/widgets/session_info_card.dart

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -162,20 +162,19 @@ class _SessionInfoContent extends StatelessWidget {
162162
const SizedBox(height: 12),
163163
Row(
164164
children: [
165-
// QR code button (if QR mode)
166-
if (session.securityMode == SecurityMode.qr)
167-
Expanded(
168-
child: _ActionButton(
169-
icon: Icons.qr_code,
170-
label: 'Show QR',
171-
colors: colors,
172-
onTap: () => _showQrSheet(context),
173-
),
165+
// QR code button (always available for easy session sharing)
166+
Expanded(
167+
child: _ActionButton(
168+
icon: Icons.qr_code,
169+
label: 'Show QR',
170+
colors: colors,
171+
onTap: () => _showQrSheet(context),
174172
),
173+
),
174+
175+
const SizedBox(width: 8),
175176

176177
// Share button
177-
if (session.securityMode == SecurityMode.qr)
178-
const SizedBox(width: 8),
179178
Expanded(
180179
child: _ActionButton(
181180
icon: Icons.share,

lib/ui/screens/map/map_screen.dart

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ import 'layers/peer_markers_layer.dart';
3939
import 'layers/synced_markers_layer.dart';
4040
import 'widgets/annotation_toolbar.dart';
4141
import 'widgets/coordinate_bar.dart';
42+
import 'widgets/emergency_alert_overlay.dart';
4243
import 'widgets/map_controls.dart';
44+
import 'widgets/message_banner.dart';
45+
import 'widgets/message_bar.dart';
46+
import 'widgets/sos_button.dart';
4347
import 'widgets/waypoint_action_sheet.dart';
4448

4549
class MapScreen extends ConsumerStatefulWidget {
@@ -278,13 +282,36 @@ class _MapScreenState extends ConsumerState<MapScreen> {
278282
child: AnnotationToolbar(colors: colors),
279283
),
280284

285+
// ── Message bar (above coordinate bar, session-gated) ────────────
286+
if (isSessionActive)
287+
Positioned(
288+
left: 0,
289+
right: 0,
290+
bottom: 44, // Above coordinate bar
291+
child: MessageBar(colors: colors),
292+
),
293+
294+
// ── SOS button (session-gated; widget self-positions) ─────────────
295+
if (isSessionActive) const SosButton(),
296+
281297
// ── Coordinate bar (bottom) ────────────────────────────────────
282298
Positioned(
283299
left: 0,
284300
right: 0,
285301
bottom: 0,
286302
child: CoordinateBar(colors: colors),
287303
),
304+
305+
// ── Message banner (top slide-in notification) ─────────────────
306+
Positioned(
307+
top: 0,
308+
left: 0,
309+
right: 0,
310+
child: MessageBanner(colors: colors),
311+
),
312+
313+
// ── Emergency alert overlay (highest z-order) ──────────────────
314+
const EmergencyAlertOverlay(),
288315
],
289316
),
290317
);

lib/ui/screens/map/widgets/sos_button.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class _SosButtonState extends ConsumerState<SosButton>
4242
}
4343

4444
@override
45-
Widget build(BuildContext context, WidgetRef ref) {
45+
Widget build(BuildContext context) {
4646
final isSessionActive = ref.watch(isSessionActiveProvider);
4747
if (!isSessionActive) return const SizedBox.shrink();
4848

pubspec.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -792,10 +792,10 @@ packages:
792792
dependency: "direct main"
793793
description:
794794
name: mobile_scanner
795-
sha256: "827765afbd4792ff3fd105ad593821ac0f6d8a7d352689013b07ee85be336312"
795+
sha256: d234581c090526676fd8fab4ada92f35c6746e3fb4f05a399665d75a399fb760
796796
url: "https://pub.dev"
797797
source: hosted
798-
version: "4.0.1"
798+
version: "5.2.3"
799799
mockito:
800800
dependency: "direct dev"
801801
description:

0 commit comments

Comments
 (0)