Not sure what the right behavior/docs are, but I found it surprising that Platform.environment returns a new Map every time I access the getter.
import 'dart:io';
void main() {
var stuff = Platform.environment;
print(stuff);
stuff['foo'] = 'bar';
print(stuff);
var stuff2 = Platform.environment;
print(stuff2);
print(stuff2['foo']); // XXX this is null
}
Either Platform.environment is meant to return a singleton map (one map for the platform), or is meant to return an unmodifiable map, or is meant to always return a mutable copy.
If the last case, I recommend we update the API docs.
Thoughts?