From 7fb467872a030d9a3dc76e836cbf271883f5b99e Mon Sep 17 00:00:00 2001 From: stopflock Date: Sun, 7 Dec 2025 15:09:31 -0600 Subject: [PATCH] Clean up debug logging --- .../coordinators/sheet_coordinator.dart | 18 ++++-------------- lib/screens/home_screen.dart | 2 -- lib/widgets/measured_sheet.dart | 11 ----------- 3 files changed, 4 insertions(+), 27 deletions(-) diff --git a/lib/screens/coordinators/sheet_coordinator.dart b/lib/screens/coordinators/sheet_coordinator.dart index 9399de3..73b3f86 100644 --- a/lib/screens/coordinators/sheet_coordinator.dart +++ b/lib/screens/coordinators/sheet_coordinator.dart @@ -37,17 +37,10 @@ class SheetCoordinator { /// Get the currently active sheet height for map positioning double get activeSheetHeight { - final height = _addSheetHeight > 0 ? _addSheetHeight : - _editSheetHeight > 0 ? _editSheetHeight : - _navigationSheetHeight > 0 ? _navigationSheetHeight : - _tagSheetHeight; - - // Add debug logging to help troubleshoot sheet height coordination - if (height > 0) { - debugPrint('[SheetCoordinator] Active sheet height: $height (add: $_addSheetHeight, edit: $_editSheetHeight, nav: $_navigationSheetHeight, tag: $_tagSheetHeight)'); - } - - return height; + if (_addSheetHeight > 0) return _addSheetHeight; + if (_editSheetHeight > 0) return _editSheetHeight; + if (_navigationSheetHeight > 0) return _navigationSheetHeight; + return _tagSheetHeight; } /// Update sheet state tracking @@ -107,7 +100,6 @@ class SheetCoordinator { bottom: MediaQuery.of(context).padding.bottom, // Only safe area, no keyboard ), child: MeasuredSheet( - debugLabel: 'AddNode', onHeightChanged: (height) { _addSheetHeight = height + MediaQuery.of(context).padding.bottom; onStateChanged(); @@ -171,7 +163,6 @@ class SheetCoordinator { bottom: MediaQuery.of(context).viewInsets.bottom + MediaQuery.of(context).padding.bottom, ), child: MeasuredSheet( - debugLabel: 'EditNode', onHeightChanged: (height) { final fullHeight = height + MediaQuery.of(context).viewInsets.bottom + MediaQuery.of(context).padding.bottom; _editSheetHeight = fullHeight; @@ -211,7 +202,6 @@ class SheetCoordinator { bottom: MediaQuery.of(context).viewInsets.bottom + MediaQuery.of(context).padding.bottom, ), child: MeasuredSheet( - debugLabel: 'Navigation', onHeightChanged: (height) { final fullHeight = height + MediaQuery.of(context).viewInsets.bottom + MediaQuery.of(context).padding.bottom; _navigationSheetHeight = fullHeight; diff --git a/lib/screens/home_screen.dart b/lib/screens/home_screen.dart index 81ca93c..fc7773f 100644 --- a/lib/screens/home_screen.dart +++ b/lib/screens/home_screen.dart @@ -301,7 +301,6 @@ class _HomeScreenState extends State with TickerProviderStateMixin { bottom: MediaQuery.of(context).padding.bottom, // Only safe area, no keyboard ), child: MeasuredSheet( - debugLabel: 'NodeTag', onHeightChanged: (height) { _sheetCoordinator.updateTagSheetHeight( height + MediaQuery.of(context).padding.bottom, @@ -359,7 +358,6 @@ class _HomeScreenState extends State with TickerProviderStateMixin { bottom: MediaQuery.of(context).padding.bottom, // Only safe area, no keyboard ), child: MeasuredSheet( - debugLabel: 'SuspectedLocation', onHeightChanged: (height) { _sheetCoordinator.updateTagSheetHeight( height + MediaQuery.of(context).padding.bottom, diff --git a/lib/widgets/measured_sheet.dart b/lib/widgets/measured_sheet.dart index 91c4e02..1ed2bab 100644 --- a/lib/widgets/measured_sheet.dart +++ b/lib/widgets/measured_sheet.dart @@ -4,13 +4,11 @@ import 'package:flutter/material.dart'; class MeasuredSheet extends StatefulWidget { final Widget child; final ValueChanged onHeightChanged; - final String? debugLabel; // Add debug label for troubleshooting const MeasuredSheet({ super.key, required this.child, required this.onHeightChanged, - this.debugLabel, }); @override @@ -34,17 +32,8 @@ class _MeasuredSheetState extends State { final height = renderBox.size.height; if (height != _lastHeight) { _lastHeight = height; - // Add debug logging to help troubleshoot height measurement issues - if (widget.debugLabel != null) { - debugPrint('[MeasuredSheet-${widget.debugLabel}] Height changed: $_lastHeight -> $height'); - } widget.onHeightChanged(height); } - } else { - // Add debug logging for measurement failures - if (widget.debugLabel != null) { - debugPrint('[MeasuredSheet-${widget.debugLabel}] Failed to measure height: renderBox is null'); - } } }