Closed yeras-is closed 2 years ago
We faced the same issue. Looks like map covers all the rest stacked Positioned
widgets in Android (it doesn't matter whether I use emulator or run on a real device). It worked in Flutter 2 and still works in Flutter 3 in iOS. Here is simplified code snippet:
Scaffold(
key: _scaffoldKey,
body: SafeArea(
top: false,
child: Stack(
children: [
YandexMap(onMapCreated: ...),
Stack(
children: [
if (widget.cancelable) Positioned(left: 8.w, top: 32.h, child: const AddressMapBackButton()),
Positioned(
bottom: media.padding.bottom + (_modalSize?.height ?? 0) + 16.h,
left: 16.w,
right: 16.w,
child: Column(...),
),
],
);
],
),
),
),
We're using yandex_mapkit@1.1.1
but upgrading to the recent version 2.0.5
also doesn't help.
Hello!
Please include your error log and a sample reproducing said problem.
Also you can turn off hybrid rendering like this AndroidYandexMap.useAndroidViewSurface = false
Logs
Connecting to VM Service at ws://127.0.0.1:57366/Wrtim0rOOck=/ws
D/FRCPlugin( 8165): Sending fetchTimeout: 10
I/AppMetrica( 8165): Initializing of Metrica, Release type, Version 3.21.0, API Level 95, Dated 26.05.2021.
I/AppMetrica( 8165): Activate AppMetrica with APIKey 31c4116d-xxxx-xxxx-xxxx-xxxxxxxx8fd8
I/AppMetrica( 8165): [kz.magnum.go.android] : [31c4116d-xxxx-xxxx-xxxx-xxxxxxxx8fd8] Enable activity auto tracking
I/AppMetrica( 8165): [kz.magnum.go.android] : [31c4116d-xxxx-xxxx-xxxx-xxxxxxxx8fd8] Event received: Metrica installed
I/AppMetrica( 8165): Activate reporter with APIKey 20799a27-xxxx-xxxx-xxxx-xxxxxxxx4180
2
D/FRCPlugin( 8165): Sending fetchTimeout: 10
[MGO] route pushed: _CustomPageBasedPageRouteBuilder<dynamic>(CustomPage<dynamic>("AddressMapRoute", null, AddressMapRouteArgs{key: null, initialAddress: null, cancelable: false, onConfirm: null}), animation: AnimationController#20285(⏭ 1.000; paused; for _CustomPageBasedPageRouteBuilder<dynamic>(AddressMapRoute)))
W/yandex.maps( 8165): yandex::maps::runtime::api_key::ApiKey::setValue: API key is already set. Ignored.
W/yandex.maps( 8165): yandex::maps::runtime::locale::internal::LocaleManager::setLocale: Locale is already set. Ignored.
W/yandex.maps( 8165): yandex::maps::mapkit::layers::createGroundLayerUpdater: Layer: map, url: https://proxy.mob.maps.yandex.net:443/mapkit2/layers/2.x/map/tiles
W/yandex.maps( 8165): yandex::maps::mapkit::layers::createGroundLayerUpdater: Layer: sat, url: https://proxy.mob.maps.yandex.net:443/mapkit2/layers/2.x/sat/tiles
W/yandex.maps( 8165): yandex::maps::mapkit::layers::createGroundLayerUpdater: Layer: vskl2, url: https://proxy.mob.maps.yandex.net:443/mapkit2/layers/2.x/vskl2/tiles
W/yandex.maps( 8165): yandex::maps::mapkit::layers::createGroundLayerUpdater: Layer: vmap2, url: https://proxy.mob.maps.yandex.net:443/mapkit2/layers/2.x/vmap2/tiles
E/FrameEvents( 8165): updateAcquireFence: Did not find frame.
D/HostConnection( 8165): createUnique: call
D/HostConnection( 8165): HostConnection::get() New Host Connection established 0xb40000751d64aed0, tid 8351
D/HostConnection( 8165): HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV_Cache ANDROID_EMU_vulkan_ignored_handles ANDROID_EMU_has_shared_slots_host_memory_allocator ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit ANDROID_EMU_vulkan_queue_submit_with_commands ANDROID_EMU_sync_buffer_data ANDROID_EMU_read_color_buffer_dma ANDROID_EMU_hwc_multi_configs GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_3_0
E/FrameEvents( 8165): updateAcquireFence: Did not find frame.
W/yandex.maps( 8165): yandex::maps::runtime::logging::warn: Create OpenGl ES context version 3
D/EGL_emulation( 8165): eglCreateContext: 0xb40000751d649610: maj 3 min 0 rcv 3
D/EGL_emulation( 8165): eglMakeCurrent: 0xb40000751d649610: ver 3 0 (tinfo 0x7731a00280) (first time)
E/FrameEvents( 8165): updateAcquireFence: Did not find frame.
D/EGL_emulation( 8165): app_time_stats: avg=8.76ms min=2.71ms max=30.90ms count=48
W/yandex.maps( 8165): yandex::maps::mapkit::textures::Atlas::addTexture: Atlas: LayersAtlas. Page: 2 created. That could seriously decrease rendering speed
W/yandex.maps( 8165): yandex::maps::mapkit::textures::Atlas::addTexture: Atlas: LayersAtlas. Page: 3 created. That could seriously decrease rendering speed
E/yandex.maps( 8165): yandex::maps::mapkit::images::PolylineImageAtlas::add: Width of pattern is equal to 268, but should be power of 2. Added transparent padding
D/EGL_emulation( 8165): app_time_stats: avg=85.69ms min=3.40ms max=2978.73ms count=38
D/EGL_emulation( 8165): app_time_stats: avg=1694.64ms min=65.13ms max=4803.16ms count=3
W/yandex.maps( 8165): yandex::maps::mapkit::textures::Atlas::addTexture: Atlas: LayersAtlas. Page: 4 created. That could seriously decrease rendering speed
W/yandex.maps( 8165): yandex::maps::mapkit::textures::Atlas::addTexture: Atlas: LayersAtlas. Page: 5 created. That could seriously decrease rendering speed
W/yandex.maps( 8165): yandex::maps::mapkit::textures::Atlas::addTexture: Atlas: LayersAtlas. Page: 6 created. That could seriously decrease rendering speed
W/yandex.maps( 8165): yandex::maps::mapkit::textures::Atlas::addTexture: Atlas: LayersAtlas. Page: 7 created. That could seriously decrease rendering speed
W/yandex.maps( 8165): yandex::maps::mapkit::textures::Atlas::addTexture: Atlas: LayersAtlas. Page: 8 created. That could seriously decrease rendering speed
Sample
return Scaffold(
body: SafeArea(
top: false,
child: Stack(
children: const [
YandexMap(),
Positioned(
bottom: 40,
right: 10,
left: 10,
child: ColoredBox(
color: Colors.red,
child: SizedBox(
height: 50,
width: 50,
),
),
),
],
),
),
);
AndroidYandexMap.useAndroidViewSurface = false
renders well
Looking at your log I don't see any errors.
Your provided example also doesn't produce any errors, the red box appears in front of YandexMap as expected.
Do you used version 3 of flutter and android platform ?
Yes, I tested using 3.0.0
AndroidYandexMap.useAndroidViewSurface = false
Example plz. Where I should paste this?
AndroidYandexMap.useAndroidViewSurface = false
Example plz. Where I should paste this?
Ok, I find out that this worked only with yandex_mapkit 2.0.0+
@prosky5
You can paste this anywhere you like, only before using YandexMap
widget.
Closing since no reproducible example nor any error log has been given.
Hi, after upgrading the framework version, when I try to create screen using Stack and there is a Yandex map at the bottom, and modal windows on top, then I get error that Yandex Map is on top of Stack only on the Android platform, on iOS platform every thing is ok. I suspect the problem is hybrid rendering on the android platform, is there any solution for that?