Separating build environments in flutter
This is a companion repository for my youtube tutorial regarding flutter flavors. This consists of a 3 part tutorial.
In this part, we will learn to separate build environment and configs in dart side, we will learn to create separate main files each for the build flavors we want and apply different configs to each app.
- Starting code is in part2-start branch.
- Final code is in part2-finish branch
In part 2 we will learn to setup flavors in android side which will allow us to use two separate firebase configs based on flavors in our flutter project in android.
- Starting code is in part3-start branch.
- Final code is in part3-finish branch
In part 3 we will learn to setup schemas in iOS side, and make our flutter app able to use separate firebase config in iOS.
if [ "${CONFIGURATION}" == "Debug-prod" ] || [ "${CONFIGURATION}" == "Release-prod" ] || [ "${CONFIGURATION}" == "Release" ]; then
cp -r "${PROJECT_DIR}/Runner/Firebase/prod/GoogleService-Info.plist" "${PROJECT_DIR}/Runner/GoogleService-Info.plist"
echo "Production plist copied"
elif [ "${CONFIGURATION}" == "Debug-dev" ] || [ "${CONFIGURATION}" == "Release-dev" ] || [ "${CONFIGURATION}" == "Debug" ]; then
cp -r "${PROJECT_DIR}/Runner/Firebase/dev/GoogleService-Info.plist" "${PROJECT_DIR}/Runner/GoogleService-Info.plist"
echo "Development plist copied"
fi