Navigációs képernyőn forráspontok megjelenítése
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 9s

This commit is contained in:
2026-10-04 20:18:08 +02:00
parent e801090e90
commit e3ff7d070c
10 changed files with 1100 additions and 626 deletions
+17 -6
View File
@@ -42,9 +42,18 @@ class AnimatedMapFollow extends StatelessWidget {
duration: duration,
curve: Curves.easeOut,
builder: (context, animatedPos, _) {
try {
mapController.move(animatedPos, mapController.camera.zoom);
} catch (_) {}
// NE hívjuk a .move()-ot közvetlenül itt — ez a builder BUILD
// közben fut, a mapController.move() pedig a flutter_map
// belső gesztus-kezelő widgetjén (MapInteractiveViewer) vált
// ki setState()-et, ami "setState() called during build"
// hibát ad. A jelenlegi képkocka VÉGÉRE halasztjuk, ahol ez
// már biztonságos — ugyanaz az elv, mint az
// onPositionChanged-nél.
WidgetsBinding.instance.addPostFrameCallback((_) {
try {
mapController.move(animatedPos, mapController.camera.zoom);
} catch (_) {}
});
return const SizedBox.shrink();
},
),
@@ -55,9 +64,11 @@ class AnimatedMapFollow extends StatelessWidget {
duration: duration,
curve: Curves.easeOut,
builder: (context, animatedRotation, _) {
try {
mapController.rotate(animatedRotation);
} catch (_) {}
WidgetsBinding.instance.addPostFrameCallback((_) {
try {
mapController.rotate(animatedRotation);
} catch (_) {}
});
return const SizedBox.shrink();
},
),