EDIT: Look at J. Saw’s comment below.
EDIT 2: The issue in described at the bottom has been fixed in firebase-config 19.0.2.
Use Inside the Firebase console, inside the menu, scroll down to Firebase Remote Config.Grow and then Remote Config. Here you can add a parameter with a value. When you’re done don’t forget to publish the changes. It’s kind of subtle.

Now install firebase_remote_config for Flutter.
After importing everything, you can retrieve your value using this code:
RemoteConfig remoteConfig = await RemoteConfig.instance;
await remoteConfig.fetch(expiration: Duration(hours: 1));
await remoteConfig.activateFetched();
remoteConfig.getValue('key').asString();
This way, the API key or token is never part of your application.
Note: there is currently an issue where you get a warning stating the application’s name is not set, but this won’t affect functionality.