Map<String, dynamic> toJson() => <String, dynamic>{ 'accessToken': accessToken, if (refreshToken != null) 'refreshToken': refreshToken, 'idToken': idToken, 'scopes': scopes, };