query static method

Future<List<String>> query(
  1. String term,
  2. Map<String, String> apiKeys, {
  3. Language language = Language.en_US,
  4. bool prefix = false,
  5. int? limit,
  6. int? offset,
  7. Iterable<String>? grammaticalFeatures,
  8. PartOfSpeech? lexicalCategory,
  9. Iterable<String>? domains,
})

Queries the SearchEndpoint for a List<String> for the term and optional parameters.

Implementation

static Future<List<String>> query(String term, Map<String, String> apiKeys,
    {Language language = Language.en_US,
    bool prefix = false,
    int? limit,
    int? offset,
    Iterable<String>? grammaticalFeatures,
    PartOfSpeech? lexicalCategory,
    Iterable<String>? domains}) async {
  assert(limit == null || (limit < 5001 && limit >= 0),
      '[limit] must be null or between 0 and 5,000 inclusive');
  assert(offset == null || (offset < 10001 && offset >= 0),
      '[offset] must be null or between 0 and 10,000 inclusive');
  assert(((limit ?? 0) + (offset ?? 0) <= 10000),
      'Sum of limit and offset must be less that 10,000');
  return await SearchEndpoint._(
              term, apiKeys, language, prefix, limit, offset)
          .get() ??
      [];
}