[Android] onStyleLoadedListener is delayed until an inactive AutoTabsScaffold tab becomes active when using Hybrid Composition
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 55/100
Direzione di ricerca
Start by tracing MapWidget creation and onStyleLoadedListener through the Android Platform View integration, then compare Hybrid Composition with the VD hosting mode described in the workaround. Reproduce the inactive mounted tab case in the stated Flutter and plugin versions. Done means the style-loaded callback fires before the tab becomes active under Hybrid Composition, while the related issue’s distinct reproduction remains understood.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
After migrating to mapbox_maps_flutter 3.x, the map style does not finish loading while the map is hosted in an inactive tab of an AutoTabsScaffold when using Hybrid Composition.
The map is created immediately because AutoTabsScaffold uses lazyLoad: false. The onMapCreated callback is invoked during the initial screen setup, but onStyleLoadedListener is not invoked until the user navigates to the map tab.
This delays the initialization of custom style layers.
Environment
- Flutter: 3.47.8
mapbox_maps_flutter: 3.33.1- Platform: Android
- Navigation:
AutoTabsScaffoldwithlazyLoad: false
Expected behavior
The map should initialize its style and emit onStyleLoadedListener while its tab is inactive but mounted, allowing the application to prepare style and custom layers before the user navigates to the map tab.
Actual behavior
The map is created, but the style-loaded callback is delayed until the map tab becomes active.
Workaround
Setting androidHostingMode: AndroidPlatformViewHostingMode.VD while keeping textureView: true resolves the issue. This configuration enables the expected behavior.
MapWidget(
textureView: true,
androidHostingMode: AndroidPlatformViewHostingMode.VD,
onMapCreated: onMapCreated,
onStyleLoadedListener: onStyleLoaded,
)
Related issue
https://github.com/mapbox/mapbox-maps-flutter/issues/1147
The two issues appear to be related to the Android Platform View integration, but they have different reproduction steps and workarounds.
- Lingua principale
- Dart
- Stelle
- 379
- Fork
- 205
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di mapbox/mapbox-maps-flutter
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
mapbox/mapbox-maps-flutter#1147 · 2 commenti ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
mapbox/mapbox-maps-flutter#1146 · 3 commenti ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
mapbox/mapbox-maps-flutter#1144 ·
-
iOS: the map cannot be captured or read by flutter, because it is a platform viewForse già presa @Nixxx19 l’ha presa 66 giorni fa. Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
mapbox/mapbox-maps-flutter#1142 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 58/100
mapbox/mapbox-maps-flutter#1140 ·
Tutte le issue di mapbox/mapbox-maps-flutter
Issue simili
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
lollipopkit/flutter_server_box#1851 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
type:feature
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
mikejr83/rc-soar-score#724 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
ccch1mneyyy/dsh-Go#381 ·
I maintainer di solito rispondono entro 1 giorno
-
Broken links in the docsAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
letsar/flutter_slidable#563 ·
I maintainer di solito rispondono entro 1 giorno
-
bot-found bug priority: P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
madenvel/KalinkaPlayer#498 ·