get method

Future<Category> get(
  1. String categoryId, {
  2. Market? country,
  3. String? locale,
})

country - a country: an ISO 3166-1 alpha-2 country code. Provide this parameter to ensure that the category exists for a particular country.

locale - the desired language, consisting of an ISO 639-1 language code and an ISO 3166-1 alpha-2 country code, joined by an underscore. For example: es_MX, meaning "Spanish (Mexico)". Provide this parameter if you want the category strings returned in a particular language. Note that, if locale is not supplied, or if the specified language is not available, the category strings returned will be in the Spotify default language (American English).

categoryId - the Spotify category ID for the category.

Implementation

Future<Category> get(String categoryId,
    {Market? country, String? locale}) async {
  final query = _buildQuery({'country': country?.name, 'locale': locale});

  var jsonString = await _api._get('$_path/$categoryId?$query');
  var map = json.decode(jsonString);

  return Category.fromJson(map);
}