-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Closed
Copy link
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work listc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Fluttercustomer: googleVarious Google teamsVarious Google teamscustomer: huggsy (g3)p: mapsGoogle Maps pluginGoogle Maps pluginpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.team-ecosystemOwned by Ecosystem teamOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem teamTriaged by Ecosystem team
Description
Internal: b/249358651
Use case
It's currently possible to set a custom map style once the GoogleMap widget is rendered.
GoogleMap(
onCameraMove: (CameraPosition cameraPosition) {
loadNewPubs(cameraPosition);
},
onMapCreated: _onMapCreated,
initialCameraPosition: CameraPosition(
target: LatLng(lat, lng),
zoom: 15,
),
myLocationButtonEnabled: false,
myLocationEnabled: true,
mapToolbarEnabled: false,
zoomControlsEnabled: false,
markers: Set<Marker>.of(markers.values),
),
void _onMapCreated(GoogleMapController controller) {
setState(() {
_mapController = controller;
_mapController.setMapStyle(_mapStyle).whenComplete(() {
});
});
}
This results in a "flash" which is especially disturbing when using a dark map style.
Demonstrated in this video on an iPhone 11 Pro simulator.
The behavior:
- the widget isn't loaded: a pure white screen is rendered for a few 100 milliseconds.
- the default map style is rendered white yellow (beige) color, this is more visible.
- the custom map style is rendered
Proposal
To avoid step 1: a possibility to set a custom background color (now it's the color white).
To avoid step 2: a possibility to set the map style before the googleMap widget is rendered and not on onMapCreated.
HudsonAfonso, abhaysood, ozzy1873, cedvdb, BramDriesen and 4 more
Metadata
Metadata
Assignees
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work listc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Fluttercustomer: googleVarious Google teamsVarious Google teamscustomer: huggsy (g3)p: mapsGoogle Maps pluginGoogle Maps pluginpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.team-ecosystemOwned by Ecosystem teamOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem teamTriaged by Ecosystem team
