cachedOverview abstract method

Future<OverviewResponse> cachedOverview()

Returns cached all learned words associated with the language that the authenticated user is currently learning.

The first call to this cachedOverview method will always result in a communication with the Duolingo API because there is no cached OverviewResponse. In the second and subsequent method calls, the cached OverviewResponse from the first method call will be returned.

The type and data structure of the response is consistent with the overview method. However, please note that the cached data is returned from this method, so unless you explicitly delete this cached object data, the cached response object will always be returned.

To delete the explicitly cached OverviewResponse, call the cleanCachedOverview method.

Example:

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

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

 final overviewResponse = await duolingo.cachedOverview();

 for (final vocabulary in overviewResponse.vocabularies) {
     print(vocabulary.word);

 // Delete cache.
 duolingo.cleanCachedOverview();
}

Implementation

Future<OverviewResponse> cachedOverview();