I have a Flutter app with three different flavors: development, staging, and production. I would like to use a different Firebase project for each flavor so that the data for each flavor is kept separate.
What is the best way to configure Firebase for different flavors in a Flutter app? Should I create separate google-services.json files for each flavor, or is there another method I can use?
Here's my current setup in build.gradle:
flavorDimensions "default"
productFlavors {
development {
dimension "default"
applicationIdSuffix ".dev"
versionNameSuffix "-dev"
}
staging {
dimension "default"
applicationIdSuffix ".staging"
versionNameSuffix "-staging"
}
production {
dimension "default"
}
}
buildTypes {
release {
// ...
}
debug {
// ...
}
}
I was expecting that each flavor of my app would use a different Firebase project and that the data for each flavor would be kept separate. However, I'm not sure how to configure Firebase properly for each flavor, and I'm not sure if there are any additional steps I need to take beyond creating separate google-services.json files.
When I run my app with the different flavors, Firebase seems to be using the same project for each flavor, which is causing conflicts with the data. I'm not sure how to resolve this issue, and any help would be greatly appreciated.