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);
},
);
}),
最佳答案
作为解决方法,我将 map 放在一个堆栈中。
这个堆栈中充满了 map 和一个容器。
容器在一小段时间(100 毫秒)后设置为透明。
关于ios - 在 iOS 上更新 map 样式时白色闪烁,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59313163/