title: Doing Dot notation for Dart Objects?
body: <p>I am currently working on a localization class which will be static and accessed in other parts of the application, in dart.</p>
  
  <p>My target goal is to wire up code in a simple fashion:</p>
  
  <pre><code>Localization.MY_STRING
  </code></pre>
  
  <p>and then it will return: <code>"my string"</code></p>
  
  <p>At first, I was thinking that everything in localization would be static and publicly available, but writing everything out:</p>
  
  <pre><code>static String MY_STRING = "my string";
  </code></pre>
  
  <p>seems tedious, plus i was wanting it to be in a Map, sort of like JSON files:</p>
  
  <pre><code>{
    MY_STRING: "my string"
  }
  </code></pre>
  
  <p>Is there a simple way to create a static map so i can accomplish my goals?</p>
  
  <p>I was thinking i might be able to override the <code>.</code> by maybe defining it: </p>
  
  <pre><code>String .operator (String value){ 
    return map[value]?map[value]:"";
  }
  </code></pre>
  
  <p>in a similar fashion to defining <code>&lt;=operator</code> in classes.</p>
  
  <p>Has anyone else tried anything like this?  Im thinking I might for the timing being storing everything in a JSON file, and then just reading that information in to some class.</p>