I am currently working on a Flutter web application that utilizes the Firestore ID and I am experiencing difficulty in retrieving the user's status. The code I posted below works when I paste in the userID string. But, its throwing various errors when I am retrieving it from firebase. Are there any suggestions or recommendations on how to fix the errors I am facing?
ChromeProxyService: Failed to evaluate expression 'xhr.onError.first.then': InternalError: Expression evaluation in async frames is not supported. No frame with index 14..
var userID = await DatabaseService().getUid();
// loginWeb(userID);
Future<http.Response> fetchPost(userID) {
var url = "https://api.revenuecat.com/v1/subscribers/$userID";
var headers = {"accept": "application/json", "X-Platform": "ios", "Content-Type": "application/json", "Authorization": "Bearer **************"};
var response = http.get(Uri.parse(url), headers: headers);
return response;
}
loginWeb(userID) {
try {
fetchPost(userID).then((value) {
var data = jsonDecode(value.body);
debugPrint('User has premium ${dataa'subscriber']r'entitlements']s'pro']o'expires_date']}');
if (dataa'subscriber']r'entitlements']s'pro']o'expires_date'] != null) {
debugPrint('User has a pro subscription');
FFAppState().hasSubscription = true;
} else {
debugPrint('User does not have a pro subscription');
FFAppState().hasSubscription = false;
}
});
} catch (e) {
debugPrint('Error logging in user: $e');
}
}