getList method

Future<List> getList(
  1. String endpoint
)

Make a GET request and return list response

Implementation

Future<List<dynamic>> getList(String endpoint) async {
  try {
    final response = await _dio.get(endpoint);

    if (response.statusCode != 200) {
      throw ProviderError(
        'ElevenLabs API returned status ${response.statusCode}: ${response.data}',
      );
    }

    return response.data as List<dynamic>;
  } on DioException catch (e) {
    throw DioErrorHandler.handleDioError(e, 'ElevenLabs');
  }
}