trendingSearch method

Get trending search Provides users a list of the most popular trending search terms on the GIPHY network.

Implementation

Future<SuccessTrendingSearchResponseModel> trendingSearch() async {
  const baseUrl = GiphyAPIPath.baseUrl;

  final pathSegments = [
    GiphyAPIPath.version1,
    GiphyAPIPath.trendingSearchTerms,
  ];

  Map<String, dynamic> queryParameters = {
    'api_key': apiKey,
  };

  // Make the request

  final responseMap = await GiphyApiManager.get(
    baseUrl,
    pathSegments,
    queryParameters: queryParameters,
    debugMode: debugMode,
  );

  // Parse the response

  return SuccessTrendingSearchResponseModel.fromJson(responseMap);
}