Reputation: 9943
Is it possible to make a preview from an url, grabbing all the information such as title, relevant texts and images. Is there any plugins I can use readily?
See this Native android plugin
Upvotes: 6
Views: 3570
Reputation: 8248
I know I'm a bit late but I found a solution for that.
The comment of Sudip might work but if you have a lot of preview to generate, you will have to subscribe and pay..
I couldn't use the library rich_link_preview because of some depency issues (it requires http < 1.12.0
).
So I had to do it myself. Writting the complete answer in this comment would be too long so I'll tell you how I did it. I followed this youtube tutorial. If you are too lazy to watch the entire video you can look at his Github Repo. It worked for me and it is not too long (there are only 2 relevant files):
Upvotes: 0
Reputation: 2436
Hope I'm not late to answer this question, There is a plugin for link with previews Rich link preview
Upvotes: 1
Reputation: 166
Currently, there is not an open source library for flutter providing these meta tags for a website.
There is a temporal solution, using these freemium APIs for getting this information. The main drawback is that the requests are limited before paying.
Upvotes: 0
Reputation: 31
You can do this way :
1)Create a user at https://www.linkpreview.net
2)Generate an Access Key.
3)From your code call
http://api.linkpreview.net/?key=<Your_API_KEY_From_Step_2>&q=https://www.google.com
It returns the meta tags in JSON as below :
{"title":"Google","description":"Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.","image":"http:\/\/www.google.com\/images\/branding\/googlelogo\/1x\/googlelogo_white_background_color_272x92dp.png","url":"https:\/\/www.google.com\/"}
4) Use it in flutter widget to create a preview.
Upvotes: 3