IssueRaiser

String.fromEnvironment without a const silently does the wrong thing in the VM

As [44083](https://github.com/flutter/flutter/pull/44083) was merged in, I would expect it to be working in at least dev, but I am not able to get it to work as expected. I set the channel to dev (flutter channel dev), then did an upgrade (flutter upgrade). Then I issued the following: flutter -run -t lib/main_generic.dart --dart-define=ENV=DEV In my main_generic.dart I do this: var env = String.fromEnvironment("ENV", defaultValue: "PROD"); The env variable always returns PROD. Should this not be picked up and return DEV instead of defaulting to PROD? @jonahwilliams

Posted by darrinps on Apr 28, 2020, 4:54 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.3,500 issues0 comments

github (Software)

String.fromEnvironment without a const silently does the wrong thing in the VM

darrinpsApr 28, 2020, 4:54 PM

As [44083](https://github.com/flutter/flutter/pull/44083) was merged in, I would expect it to be working in at least dev, but I am not able to get it to work as expected. I set the channel to dev (flutter channel dev), then did an upgrade (flutter upgrade). Then I issued the following: flutter -run -t lib/main_generic.dart --dart-define=ENV=DEV In my main_generic.dart I do this: var env = String.fromEnvironment("ENV", defaultValue: "PROD"); The env variable always returns PROD. Should this not be picked up and return DEV instead of defaulting to PROD? @jonahwilliams

Comments (0)

No comments yet. Start the discussion.

Comment on this issue