getUriFromEndpoints static method

Uri getUriFromEndpoints({
  1. required String endpoint,
  2. Map<String, dynamic>? queryParams,
  3. bool usePrefix = false,
  4. List<String>? pathSeg,
})

it will create uri from given endpoint with including baseurl baseurl can be setup by calling setup function

Implementation

static Uri getUriFromEndpoints({required String endpoint, Map<String, dynamic>? queryParams, bool usePrefix = false, List<String>? pathSeg}) {
  return Uri(
    scheme: 'https',
    host: _host,
    path: '${usePrefix ? _prefix : ''}$endpoint${pathSeg == null ? '' : pathSeg.join('/')}',
    queryParameters: queryParams,
  );
}