Open nc-jeni opened 5 months ago
I figured it out. Running from a mobile platform it works, but from web it does not. The reason was because of cross cors.
headers: {
"Access-Control-Allow-Origin": "*",
"Content-Type": "application/json",
"Accept": "*/*"
}
Adding the option using such request headers might be an idea? @demchenkoalex
The following code is placed on my
StatefulWidget
.Called with two URLs on the Web platform I get the following response in the
data
parameter and (of course) no preview is shown, but why is thePreviewData
object empty? I have a feeling that the data are never fetched because of an async call somewhere in the flutter_link_previewer library?An error comes in
getPreviewData
whenhttp.get
is called and it goes to the catch block.Please have a look at this post for solving the problem: dart-flutter-http-request-raises-xmlhttprequest-error as it is probably the issue???