Are there any ideas how I can setup my Dart app to use different settings in debug mode (running in Dartium) and production mode?
For example, I'm using PouchDb in my app, that replicates the database to a particular CouchDb instance, given by an url: db.replicateTo(url);
In debug mode, I would like to use another CouchDb instance (another url) than in production mode.
So, are there any ideas or approaches, to use different setups in both modes?
this works since a short while:
transformers: # or dev_transformers
- $dart2js:
environment: { PROD: "true" }
access it from the code like
String.fromEnvironment()
main() {
print('PROD: ${const String.fromEnvironment('PROD')}');
// works in the browser
// prints 'PROD: null' in Dartium
// prints 'PROD: true' in Chrome
}
see also
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With