getEmail method
Future<LinkedInEmail>
getEmail({
- PreferredSizeWidget? appBar,
- bool destroySession = true,
- bool forceLogin = false,
Implementation
Future<LinkedInEmail> getEmail(
{PreferredSizeWidget? appBar,
bool destroySession = true,
bool forceLogin = false}) async {
if (accessToken == null || forceLogin)
await loginForAccessToken(destroySession: destroySession, appBar: appBar);
return await getEmailResponse(accessToken: accessToken!)
.catchError((error) {
if (error is AuthorizationErrorResponse)
throw error;
else
throw AuthorizationErrorResponse(errorDescription: error.toString());
});
}