title: StringBuffer in flutter doesn't working as expected
body: <p>I am currently just started a Flutter project and is found quite frustrated when playing around with the StringBuffer class, I am having the below codes which format and apply the url to my class;</p>
  
  <pre><code>Connector._baseUri = baseUri;
  if (Connector._baseUri.endsWith("/"))
    Connector._baseUri = Connector._baseUri.substring(0, Connector._baseUri.lastIndexOf('/'));
  Connector._baseUri = new StringBuffer([Connector._baseUri, "/"]).toString();
  </code></pre>
  
  <p>However the initial value of <code>baseUri</code> is <code>http://locahost/test////</code>, but the final value of <code>_baseUri</code> is then be settled as <code>[http://localhost/test, /]</code> which I may expect a simple <code>http://localhost/test/</code>, have also tried <code>.write()</code> and <code>.writeAll()</code>, any help will be appreciated</p>