final Completer<GoogleMapController> _mapController = Completer();
....
...
Future<void> _onMapCreated(GoogleMapController controller) async {
_mapController.complete(controller);
String value = await DefaultAssetBundle.of(context)
.loadString('assets/images/mapstyle.json');
var t = await _mapController.future;
t.setMapStyle(value);
}
final Completer<GoogleMapController> _mapController = Completer();
....
...
Future<void> _onMapCreated(GoogleMapController controller) async {
_mapController.complete(controller);
String value = await DefaultAssetBundle.of(context)
.loadString('assets/images/mapstyle.json');
var t = await _mapController.future;
t.setMapStyle(value);
}