toString method

  1. @override
String toString ()
override

Returns a string representation of this object.

Implementation

@override
String toString() {
  String url = this.url;
  String query = '';
  this.query.forEach((key, value) {
    if (query != '') {
      query += '&';
    }
    query += '$key=$value';
  });
  if (this.query.isNotEmpty) {
    query = url.contains('?') ? '&$query' : '?$query';
  }

  return url + query;
}