Fix map centering when looking at tag sheets, transition to edit sheet

This commit is contained in:
stopflock
2025-12-07 14:48:45 -06:00
parent 56d55bb922
commit 405ec220d0
9 changed files with 214 additions and 5 deletions
+3
View File
@@ -42,6 +42,9 @@ class _NodeMapMarkerState extends State<NodeMapMarker> {
if (widget.onNodeTap != null) {
widget.onNodeTap!(widget.node);
} else {
// Fallback: This should not happen if callbacks are properly provided,
// but if it does, at least open the sheet (without map coordination)
debugPrint('[NodeMapMarker] Warning: onNodeTap callback not provided, using fallback');
showModalBottomSheet(
context: context,
builder: (_) => NodeTagSheet(node: widget.node),
@@ -40,6 +40,9 @@ class _SuspectedLocationMapMarkerState extends State<SuspectedLocationMapMarker>
if (widget.onLocationTap != null) {
widget.onLocationTap!(widget.location);
} else {
// Fallback: This should not happen if callbacks are properly provided,
// but if it does, at least open the sheet (without map coordination)
debugPrint('[SuspectedLocationMapMarker] Warning: onLocationTap callback not provided, using fallback');
showModalBottomSheet(
context: context,
builder: (_) => SuspectedLocationSheet(location: widget.location),
+11
View File
@@ -4,11 +4,13 @@ import 'package:flutter/material.dart';
class MeasuredSheet extends StatefulWidget {
final Widget child;
final ValueChanged<double> onHeightChanged;
final String? debugLabel; // Add debug label for troubleshooting
const MeasuredSheet({
super.key,
required this.child,
required this.onHeightChanged,
this.debugLabel,
});
@override
@@ -32,8 +34,17 @@ class _MeasuredSheetState extends State<MeasuredSheet> {
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');
}
}
}
+2
View File
@@ -29,6 +29,8 @@ class SheetAwareMap extends StatelessWidget {
// Use the actual available height from constraints, not full screen height
final availableHeight = constraints.maxHeight;
return Stack(
children: [
AnimatedPositioned(