Flutter - How to conditionally set a variable based on Environment (TestFlight / App Store)

Viewed 446

I am trying to build a Flutter app for iOS release with the following condition.

  1. If the app is run on Testflight, the base API path should be set to https://api-qa.myapp.com/
  2. But if it's run from App Store, it should instead be set to https://api.myapp.com/

The idea is that all Testflight releases would not affect my PROD environment and should instead connect to the QA environment.

Is there a way to do this with a single build?

0 Answers
Related