Fix null-safety issue with mapBounds in getNearbyNodes

Change mapBounds from LatLngBounds? to final LatLngBounds so the
compiler can prove it's non-null after the inner try-catch. Addresses
review comment on PR #45.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Doug Borg
2026-02-09 13:47:15 -07:00
parent c13dd8e58a
commit d124cee9b3

View File

@@ -160,7 +160,7 @@ class MapViewState extends State<MapView> {
getNearbyNodes: () {
if (mounted) {
try {
LatLngBounds? mapBounds;
final LatLngBounds mapBounds;
try {
mapBounds = _controller.mapController.camera.visibleBounds;
} catch (_) {