as instructed from a similar problem Hide Google Maps API key from source control in a Flutter app
AppDelegate.m
#include "AppDelegate.h"
#include "GeneratedPluginRegistrant.h"
#import "GoogleMaps/GoogleMaps.h"
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
NSString* mapsApiKey = [[NSProcessInfo processInfo] environment][@"FLUTTER_GMAPS_API_KEY"];
[GMSServices provideAPIKey: mapsApiKey];
[GeneratedPluginRegistrant registerWithRegistry:self];
return [super application:application didFinishLaunchingWithOptions:launchOptions];
}
@end
If i change provideApiKey to @"theApiKeyImTryingToHide" everything works fine.