Comments (3)
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 :
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.
And you should also take a look at this answer:
flutter/flutter#11392 (comment)
from flutter-global-config.
Thank you for all your answers!
from flutter-global-config.
Related Issues (20)
- Cannot Update Null Value HOT 1
- Updating configuration file on update? HOT 3
- Read nested values in a json HOT 1
- Is is possible to set/read the configuration in a top level function when app is killed? HOT 1
- cant add await GlobalConfiguration().loadFromUrl( ""); to splash screean HOT 1
- Unable to use configuration value as default for a constructor parameter HOT 1
- http ^0.13.0 Library upgrade required HOT 1
- errors compiling HOT 1
- doesn't support the latest http version 0.13. HOT 4
- GlobalConfiguration().loadFromMap(appSettings).loadFromMap(devSettings); HOT 1
- Pass in default value to be returned if value not found in Global Configuration
- why could not change the config file name
- Flutter http ^0.13.2 support HOT 1
- Having issue using this packages with other null safe packages.
- why sometimes return null collection
- Keep getting undefined when trying to use this repo HOT 1
- null safety HOT 3
- Resets Configuration on Restarting Application HOT 2
- Asset Loading does'nt seems to work on Web HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter-global-config.