website
website copied to clipboard
Recommend using an APP_NAME variable instead of PRODUCT_NAME on 'Create flavors of a Flutter app' page
Page URL
https://docs.flutter.dev/deployment/flavors/
Page source
https://github.com/flutter/website/tree/main/src/deployment/flavors.md
Describe the problem
The document suggests using $(PRODUCT_NAME) to change the display name of the app. However, changing this is not a good idea as one of its values seeps into the .xcscheme files of all flavors. Namely this is what you end up with:
flavor2.xcscheme
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "flavor1.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
So you see flavor1 in flavor2's .xcscheme file. Better way is to create a new variable like APP_NAME as suggested here: https://sebastien-arbogast.com/2022/05/02/multi-environment-flutter-projects-with-flavors/#Preparing_Your_iOS_App
Expected fix
The document would not suggest editing and using PRODUCT_NAME.
Additional context
No response