title: flutter/dart static list or list of singleton object always return it's default values when calling it from another class
body: <p>i am trying to use static list as global variable that can be accessible through all the dart classes , so i have done like that:</p>
  
  <pre><code>class MyData {
  
     // initialize it to an empty list
     static var List&lt;MyObject&gt; myObjectList = new List&lt;MyObject&gt;();
  
  }
  </code></pre>
  
  <p>then in another class I load that empty list with list of MyObject (<strong>no doubt that it loaded with success</strong>) </p>
  
  <p><strong>I do add objects to that list , the list will not remain empty !!</strong></p>
  
  <p>when it comes the time to use the myObjectList in another class it returns  an empty list with 0 length</p>
  
  <pre><code>class SomeClass {
  
     .....
  
     void getMyObjectsList(){
        .....
        // this display 0 length and has no data 
        print("my static object list length == ${MyData.myObjectList.length}");
     }
  
  }
  </code></pre>
  
  <p>i have also tried using a singleton instance and it return the same result :</p>
  
  <pre><code>class MyData {
  
      static final MyData _singleton = MyData._internal();
  
      factory MyData() {
        return _singleton;
      }
  
      MyData._internal();
  
     // object property
     var List&lt;MyObject&gt; myObjectList = new List&lt;MyObject&gt;();
  
  }
  </code></pre>
  
  <p>well this also return the default value which is an empty list:</p>
  
  <pre><code>class SomeClass {
  
     .....
  
     void getMyObjectsList(){
        ....
        // this display 0 length and has no data 
        print("my singleton object list length == ${MyData().myObjectList.length}");
     }
  
  }
  </code></pre>