title: Is it possible to modify the reference of an argument in Dart?
body: <p>Not sure if the terminology in the title is 100% correct, but what I mean is easily illustrated by this example:</p>
  
  <pre><code>class MyClass{
    String str = '';  
    MyClass(this.str);
  }
  
  
  void main() {
    MyClass obj1 = MyClass('obj1 initial');
  
    print(obj1.str);
  
    doSomething(obj1);  
    print(obj1.str);
  
    doSomethingElse(obj1);
    print(obj1.str);
  }
  
  
  
  void doSomething(MyClass obj){
    obj.str = 'obj1 new string';
  }
  
  void doSomethingElse(MyClass obj){
    obj = MyClass('obj1 new object');
  }
  </code></pre>
  
  <p>This will print </p>
  
  <pre><code>obj1 initial
  obj1 new string
  obj1 new string
  </code></pre>
  
  <p>But what if I wanted <code>doSomethingElse()</code> to actually modify what <code>obj1</code> is referencing, so that the output would be:</p>
  
  <pre><code>obj1 initial
  obj1 new string
  obj1 new object
  </code></pre>
  
  <p>Is this possible in Dart, and if so, how?</p>