session property

DuolingoSession session

Returns the session information when communicating with the Duolingo API.

This session is created when the user is successfully authenticated by authenticate, so if this session method is called before the user's authentication is completed, empty session information will be returned.

Example:

void main() {
 final session = Duolingo.instance.session;

 // You can get request headers as map.
 print(session.requestHeader.toMap());

 // You can use cookie and authorization header.
 print(session.requestHeader.cookie);
 print(session.requestHeader.authHeader);
}

Implementation

DuolingoSession get session;