ios - 在 iOS 上更新 map 样式时白色闪烁

标签 ios flutter google-maps-flutter

Google map 显示在屏幕上, map 样式在创建 map 时更新为深色主题(onMapCreated)

问题是样式更改时白色闪烁,并且由于黑色主题过渡非常明显。 (参见视频)

return GoogleMap(
              myLocationButtonEnabled: false,
              zoomGesturesEnabled: false,
              scrollGesturesEnabled: true,
              mapType: MapType.normal,
              circles: circles,
              markers: markers,
              initialCameraPosition: cameraPosition,
              onMapCreated: (GoogleMapController controller) {
                _mapController = controller;
                final currentMapStyle = (_themeType == ThemeType.dark)
                    ? _darkMapStyle
                    : _normalMapStyle;
                _mapController.setMapStyle(currentMapStyle);
              },
            );
          }), 

enter image description here

最佳答案

作为解决方法,我将 map 放在一个堆栈中。

这个堆栈中充满了 map 和一个容器。

容器在一小段时间(100 毫秒)后设置为透明。

关于ios - 在 iOS 上更新 map 样式时白色闪烁,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59313163/

相关文章:

ios - 延迟后取消完成 block

dart - 访问范围外的变量

database - flutter 地传递数据

flutter - 在 Flutter Provider 中如何检查消费者接收到的数据何时更新

Flutter Google map 删除了标记点击底部右侧的导航按钮

objective-c - 如何使 BarButtonSystemItem 有边框?

iphone - 捕捉 UINavigationController native 后退按钮操作

flutter - 通过 Google-Maps Flutter 插件中标记的经纬度位置的变化来更新标记位置?

iphone - 设置 UIDatePickerModeCountDownTimer

flutter - 如何将小部件放置在具有成比例大小和位置的小部件上方