From 515b9c1f295220b51641a7e8587c514ce27948de Mon Sep 17 00:00:00 2001 From: just_stuff_tm <133525672+just-stuff-tm@users.noreply.github.com> Date: Tue, 24 Feb 2026 12:51:58 -0500 Subject: [PATCH] fix los init localization --- lib/screens/line_of_sight_map_screen.dart | 12 +++++++++++- pubspec.lock | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/screens/line_of_sight_map_screen.dart b/lib/screens/line_of_sight_map_screen.dart index 0fbc21bd..402b417e 100644 --- a/lib/screens/line_of_sight_map_screen.dart +++ b/lib/screens/line_of_sight_map_screen.dart @@ -73,6 +73,7 @@ class _LineOfSightMapScreenState extends State { bool _showMarkerLabels = true; bool _didReceivePositionUpdate = false; int _losRequestNonce = 0; + bool _initialLosScheduled = false; @override void initState() { @@ -83,7 +84,16 @@ class _LineOfSightMapScreenState extends State { _end = widget.candidates[1]; } } - _runLos(); + _scheduleInitialRun(); + } + + void _scheduleInitialRun() { + if (_initialLosScheduled) return; + _initialLosScheduled = true; + WidgetsBinding.instance.addPostFrameCallback((_) { + if (!mounted) return; + _runLos(); + }); } @override diff --git a/pubspec.lock b/pubspec.lock index aa8819e0..fa23b27e 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1140,4 +1140,4 @@ packages: version: "3.1.3" sdks: dart: ">=3.10.3 <4.0.0" - flutter: ">=3.38.4" \ No newline at end of file + flutter: ">=3.38.4"