endpoint method

Uri endpoint(
  1. String path
)

baseUrl joined with path (which starts with /).

Implementation

Uri endpoint(String path) {
  var base = baseUrl.trim();
  while (base.endsWith('/')) {
    base = base.substring(0, base.length - 1);
  }
  return Uri.parse('$base$path');
}