[Android] onStyleLoadedListener is delayed until an inactive AutoTabsScaffold tab becomes active when using Hybrid Composition
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 55/100
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- Dart
- 星标
- 379
- 派生
- 205
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
mapbox/mapbox-maps-flutter 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 45/100
mapbox/mapbox-maps-flutter#1144 ·
-
iOS: the map cannot be captured or read by flutter, because it is a platform view可能已有人在做 @Nixxx19 于 67 天前认领。 未关闭
难度 5/5 一周以上 新手友好度 25/100
mapbox/mapbox-maps-flutter#1142 ·
-
难度 3/5 1-2 天 新手友好度 58/100
mapbox/mapbox-maps-flutter#1140 ·
-
Normalize ornament positioning relative to safe areas on iOS and Android可能重新可做 @maios 于 111 天前认领,目前没有进行中的 PR。 未关闭
mapbox/mapbox-maps-flutter#1137 · 1 条评论 · 1 个 reaction · 已指派 1 人 ·
-
难度 3/5 1-2 天 新手友好度 48/100
mapbox/mapbox-maps-flutter#1136 · 1 条评论 ·
查看 mapbox/mapbox-maps-flutter 的全部 Issue
相似的 Issue
-
check-relative-paths reports links to existing directories as missing可能已有人在做 @reidbaker-agent 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
google/skills_lint.dart#202 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
-
enhancement
难度 2/5 1-3 小时 新手友好度 66/100
InlitX/GymMane#311 · 1 个 reaction ·
维护者通常 4 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
zjs81/meshcore-open#634 ·
维护者通常 1 天内回复
-
Flutter: _configureLogging passes a log level to rac_configure_logging, which expects an environment未关闭binding:flutter bug p2
难度 2/5 1-3 小时 新手友好度 62/100
RunanywhereAI/runanywhere-sdks#1246 ·
维护者通常 1 天内回复