dictionary abstract method

Future<DictionaryResponse> dictionary({
  1. required String wordId,
})

Returns the dictionary information linked to wordId.

A call to this method will always cause a communication process with the Duolingo API. If you want to reuse the cached response object, use cachedDictionary.

From this API, you can refer to the information on the official Duolingo page at the following URL: https://www.duolingo.com/dictionary/Japanese/%E6%95%B0%E5%AD%A6/00a6288128ad4e286a35078ded5ffde9

Example:

void main() async {
 final duolingo = Duolingo.instance;

 final authResponse = await duolingo.authenticate(
   username: 'test_username',
   password: 'test_password',
 );

 final dictionaryResponse = await duolingo.dictionary(
   wordId: 'cbdb71cdcf9e4715771206e1c0b0b94c',
 );

 print(dictionaryResponse);

 for (final alternativeForm in dictionaryResponse.alternativeForms) {
   print(alternativeForm);
 }

 for (final discussion in dictionaryResponse.relatedDiscussions) {
   print(discussion);
 }

 for (final lexeme in dictionaryResponse.relatedLexemes) {
   print(lexeme);
 }
}

Implementation

Future<DictionaryResponse> dictionary({
  required String wordId,
});