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