flyerhq / flutter_link_previewer

Customizable link and URL preview extracted from the provided text with the ability to render from the cache. Ideal for chat applications.
MIT License
72 stars 75 forks source link

Open link on text and image tap too #39

Closed felixgabler closed 2 years ago

felixgabler commented 2 years ago

Should I make this configurable through some parameters? Also, can the data.link ever be null?

demchenkoalex commented 2 years ago

why is it needed exactly? we had that before and removed it in favour of a link, cause the tappable area of text and image is huge and it resulted in tons of unwanted taps.

felixgabler commented 2 years ago

Oh, I didn't know you had it. At my project, we had users think it is a bug that it's not tappable because all the other modern chat apps open their previews when the image or the title is tapped. It basically is as if the title is a link itself.

demchenkoalex commented 2 years ago

That's why link has a different style and is highlighted. In Telegram only links are tappable. In Facebook Messenger there is no preview at all, but links are highlighted too. On the other hand when we had that before, and I installed the app on the phone, I would click literally every link while scrolling the chat (if a lot of links is sent) which was frustrating as hell. So this can be an option maybe (although I doubt highlighted link is worse than accidental taps which take you out of the app), but definitely not a default behaviour.

felixgabler commented 2 years ago

Definitely, I can make it optional

felixgabler commented 2 years ago

I have now made it optional. Is this better?

demchenkoalex commented 2 years ago

Thanks for the PR!

demchenkoalex commented 2 years ago

Renamed to openOnPreviewImageTap and openOnPreviewTitleTap since there is no "click" in mobile :)