50 likes | 58 Vues
Flavors are typically used to build your app for different environments such as dev and prod.
E N D
How to add flavors support? - Flutter
Why do you need flavors? Flavors are typically used to build your app for different environments such as dev and prod. For eg. - your development version of the app might want to point to an API host at dev.api.myapp.com - and your production version of the app might want to point to api.myapp.com. Instead of hardcoding these values into variables and building an app for every environment manually, the right approach is to use flavors, and supply these values as build time configurations.
Custom Schemes You need to create two schemes for two different environments: dev & prod. Follow the directions below: ● Create Scheme: dev -> Create debug, release and profile configuration for this new scheme (Project Runner -> Configuration-> Duplicate debug, release and profile configs for dev scheme) ● Rename existing Runner default scheme to prod. ● Manage scheme -> Assign correct configuration to its corresponding scheme.