I started to develop with flutter and I want to use google_maps_flutter package.
I was going through medium post in order to add map to my app (https://medium.com/flutter-io/google-maps-and-flutter-cfb330f9a245).
I added this code in AppDelegate.m
#include "AppDelegate.h"
#include "GeneratedPluginRegistrant.h"
#import "GoogleMaps/GoogleMaps.h"
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[GMSServices provideAPIKey:@"******"];
[GeneratedPluginRegistrant registerWithRegistry:self];
return [super application:application didFinishLaunchingWithOptions:launchOptions];
}
@end
and this to Info.plist
<key>io.flutter.embedded_views_preview</key>
<true/>
and this is the widget code:
import 'package:flutter/material.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
void main() => runApp(MyApp());
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
GoogleMapController mapController;
final LatLng _center = const LatLng(45.521563, -122.677433);
void _onMapCreated(GoogleMapController controller) {
mapController = controller;
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text('Maps Sample App'),
backgroundColor: Colors.green[700],
),
body: GoogleMap(
onMapCreated: _onMapCreated,
options: GoogleMapOptions(
cameraPosition: CameraPosition(
target: _center,
zoom: 11.0,
),
),
),
),
);
}
}
As the example in the post, but unfortunately I get a screen with the google maps widget but not showing a map. like this: https://i.imgur.com/HGam5ac.jpg (I can't upload an image because low reputation, sorry :( ).
Is there a problem with the sdk? or there is something to change in the code?
Thank you for your help!!

