Visual Flicker Persists When Popping Route Between Two Screens with MapWidgets
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Área
- mobile-dev
Línea de trabajo
Comienza reproduciendo el problema con dos pantallas que contengan un MapWidget, usando Navigator.push y Navigator.pop tal como se describe, y compara el comportamiento con el vídeo enlazado. Investiga el ciclo de vida de la PlatformView nativa durante la transición de pop, especialmente la limpieza del mapa que se ha extraído mientras se vuelve a mostrar el mapa de destino; se considera terminado cuando se puede volver a la primera pantalla sin parpadeos ni una pila de navegación que crezca.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Bug Description
When navigating between two screens that both contain a MapWidget, a noticeable visual flicker occurs. This happens specifically when using Navigator.pop() to return from the top screen to the one below it. The map from the screen being popped seems to briefly render over the destination screen before disappearing, creating a jarring user experience.
Steps to Reproduce
-
Create a ScreenA that contains a MapWidget.
-
Create a ScreenB that also contains a MapWidget.
-
From ScreenA, push ScreenB onto the navigation stack
(e.g., Navigator.push(context, MaterialPageRoute(builder: (_) => ScreenB()))).
- On ScreenB, have a button or back gesture that executes
Navigator.pop(context).
- Pop ScreenB to return to ScreenA.
Observe the visual flicker as ScreenA is revealed.
Expected Behavior
The navigation transition when popping the route should be smooth, without any visual artifacts or flickering from the map on the previous screen.
Current Behavior
A flicker occurs where the MapWidget from ScreenB is briefly visible during the transition back to ScreenA.
Additional Context & Workarounds Tried
I have attempted several workarounds, but none provide a complete and stable solution:
-
Using popAndPush or replaceAll: These navigation methods successfully avoid the visual flicker. However, they are not viable solutions as they create memory leaks by creating new screen instances instead of returning to the original one, causing the navigation stack to grow indefinitely.
-
This leads me to believe there is still an underlying race condition or an incomplete resource cleanup in the native PlatformView lifecycle when one map instance is destroyed while another is being revealed during a pop transition.
Video
https://github.com/user-attachments/assets/65896649-5d3a-492a-8633-e71ad72ea574
- Lenguaje dominante
- Dart
- Estrellas
- 379
- Forks
- 204
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de mapbox/mapbox-maps-flutter
-
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
mapbox/mapbox-maps-flutter#1144 ·
-
iOS: the map cannot be captured or read by flutter, because it is a platform viewPosiblemente ocupada @Nixxx19 la tomó hace 40 días. Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
mapbox/mapbox-maps-flutter#1142 ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 58/100
mapbox/mapbox-maps-flutter#1140 ·
-
Normalize ornament positioning relative to safe areas on iOS and AndroidQuizá libre de nuevo @maios la tomó hace 84 días y no hay ningún pull request abierto. Abierto
mapbox/mapbox-maps-flutter#1137 · 1 comentario · 1 reacción · 1 asignado ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 48/100
mapbox/mapbox-maps-flutter#1136 · 1 comentario ·
Todos los issues de mapbox/mapbox-maps-flutter
Issues similares
-
历史记录加上阅读时间和搜索Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
venera-app/venera-prime#25 · 1 comentario ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
genkit-ai/genkit-dart#627 ·
Los mantenedores suelen responder en 1 día
-
lang-java package:jni package:jni_flutter package:jnigen
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
dart-lang/native#3732 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
area: ui enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
area: web server enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día