1

A Google map is displayed on the screen and the map style is updated with a dark theme when the map is created (onMapCreated)

The issue is a white blink when the style is changed and it is very visible due to the black theme transition. (Cf. video)

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

fvisticot
  • 7,936
  • 14
  • 49
  • 79

1 Answers1

1

As a workaround, I placed the map in a stack.

This stack is filled with the map and a container.

The container is set to transparent after a small period (100ms).

fvisticot
  • 7,936
  • 14
  • 49
  • 79
  • Thanks for this tip! It occurs when I use mapsImplementation.useAndroidViewSurface = false and now I can hide flashing googlemaps behavior – Túlio Calazans Feb 15 '23 at 12:21