constructQuery method

String constructQuery(
  1. String search
)

Implementation

String constructQuery(String search) {
  Map<String, String> queryParams = {
    'api_key': _apiKey,
    'include_adult': 'false',
    'language': 'en',
    'page': 1.toString(),
    'query': search,
  };

  String queryString = queryParams.entries.map((entry) => '${entry.key}=${entry.value}').join('&');
  return '?$queryString';
}