I'm attempting to add opacity to the GoogleMap
widget but not seeing any changes.
I've previously tried wrapping the entire widget with a Container
then adding Opacity
and GoogleMap
as direct children but this did not work either.
The code below builds correctly, but adds no opacity:
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: Stack(
children: <Widget>[
Opacity(
opacity: 0.5,
child: GoogleMap(
onMapCreated: _onMapCreated,
myLocationButtonEnabled: false,
initialCameraPosition: CameraPosition(
target: _center,
zoom: 15.0,
),
indoorViewEnabled: false,
mapType: MapType.normal,
markers: _markers
)
),
...
]
)
)
);
}
I would expect the map to be opaque. Is this possible with GoogleMaps plugin or do they prevent styling like this?