termSearch method

Future<SuccessTermResponseModel> termSearch(
  1. String term
)

Search a term Providers users a list of tag terms related to the given tag on the GIPHY network.

Implementation

Future<SuccessTermResponseModel> termSearch(String term) async {
  const baseUrl = GiphyAPIPath.baseUrl;

  final pathSegments = [
    GiphyAPIPath.version1,
    GiphyAPIPath.searchSuggestions(term),
  ];

  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 SuccessTermResponseModel.fromJson(responseMap);
}