GithubHelp home page GithubHelp logo

Comments (3)

Ephenodrom avatar Ephenodrom commented on July 17, 2024

Hello @hunorbatori

Currently I don't know any way to achieve this easily. The current way to achieve this is to create a seperate main file for each "stage" you want to deploy.

If you have the following stages : dev / production

You would create the following main files : main_dev.dart / main_production.dart

Then you can choose how to run your app via :

flutter run -t lib/main_debug.dart

It is also possible to build the app using different main files. You have to look up for the corresponding command.

Take a look at :

https://stackoverflow.com/questions/47438564/how-do-i-build-different-versions-of-my-flutter-app-for-qa-dev-prod/53496597#53496597

Important note : This answer is from 2019, maybe there is a chance that there is a easier way. You need to somehow access the build environment in your main file then you can do some easy if-else to load the corresponding config file.

from flutter-global-config.

Ephenodrom avatar Ephenodrom commented on July 17, 2024

And you should also take a look at this answer:

flutter/flutter#11392 (comment)

from flutter-global-config.

hunorbatori avatar hunorbatori commented on July 17, 2024

Thank you for all your answers!

from flutter-global-config.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.