I've a Flutter mobile app. My app have 4 different servers each have unique purpose
Test Development Staging Production
My app have a hidden button on the login screen which won't visible to the end user. So when I developing the app I'm using development server.
The app pointing to the production server at default. When user install it from appstore or playstore they can use without changing the server.
If a tester want to test the app then he have to get the app and Need to change the server url to Test server by accessing the hidden page to change the server. Like wise if we give the app to client they have to change the server to staging...
Now my question is Is this a right way to manage the deployment process?
Having a hidden button on the production app to change the server is safe ?
How the industry is managing this process ?
You should deploy different versions of your app with flavors. With flavors you can create environments (dev, staging, prod, etc.).
See the offical Flutter docs how to setup flavors, you have to do it on the native side.
https://docs.flutter.dev/deployment/flavors?gclid=Cj0KCQiAmNeqBhD4ARIsADsYfTejoSNHLEi7TUmd-WIrO03asW-YEyedHwB4_fvCwtB4VNVt66Dn0hoaArADEALw_wcB&gclsrc=aw.ds