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;
Connector._baseUri = baseUri;
if (Connector._baseUri.endsWith("/"))
Connector._baseUri = Connector._baseUri.substring(0, Connector._baseUri.lastIndexOf('/'));
Connector._baseUri = new StringBuffer([Connector._baseUri, "/"]).toString();
However the initial value of baseUri
is http://locahost/test////
, but the final value of _baseUri
is then be settled as [http://localhost/test, /]
which I may expect a simple http://localhost/test/
, have also tried .write()
and .writeAll()
, any help will be appreciated