Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
601 views
in Technique[技术] by (71.8m points)

android - error: The method 'setMapStyle' isn't defined for the type 'Completer'

enter image description here

I'm getting this error when I'm trying to change ma Google maps Color

error: The method 'setMapStyle' isn't defined for the type 'Completer'.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

First define the Controller for the GoogleMap

  GoogleMapController mapController;

And now add that Controller to set the map style for the map in your GoogleMap Widget.

  onMapCreated: (GoogleMapController controller) {
    mapController = controller;
    mapController.setMapStyle(mapStyle);
    // _controller.complete(controller);
  },

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...