flutter – google maps demo
a flutter example to use google maps in ios and android apps via the embedded maps plugin.
android
specify your api key in the application manifest android/app/src/main/androidmanifest.xml
:
<manifest ...
<application ...
<meta-data android:name="com.google.android.geo.api_key"
android:value="your key here"/>
ios
supply your api key in the application delegate ios/runner/appdelegate.m
:
#include "appdelegate.h"
#include "generatedpluginregistrant.h"
#import "googlemaps/googlemaps.h"
@implementation appdelegate
- (bool)application:(uiapplication *)application
didfinishlaunchingwithoptions:(nsdictionary *)launchoptions {
[gmsservices provideapikey:@"your key here"];
[generatedpluginregistrant registerwithregistry:self];
return [super application:application didfinishlaunchingwithoptions:launchoptions];
}
@end
Comments are closed.