createUrl static method

String createUrl({
  1. required String path,
  2. String pathVariables = '',
})

Constructs a full URL given a specific API path and optional path variables.

The path parameter specifies the API endpoint. The pathVariables parameter specifies additional variables to be appended to the path. It defaults to an empty string.

Returns the complete URL as a string.

Implementation

static String createUrl({required String path, String pathVariables = ''}) {
  String baseUrl = ApiEnv.apiUrl;
  return '$baseUrl$path$pathVariables';
}