flutterdartweburl

Share a special link to a unique Document / Pdf / Data - Flutter


what is the right way to share a unique document/file hosted on firebase through my application on example.com.

I am creating an application where one user uploads a document (being hosted on cloud). This document then can be shared with the other users and the users know that document is authentic.

I am not really sure how to generate a unique shareable link??

Shall i Generate a separate page for each link?? Forexample some education sites use this approach (i guess) to prove the authenticity of a certificate. In this case how to generate a route in flutter automatically against each uploaded document?

Thanks in advance.


Solution

  • I figured it out. It is quite simple. You can create a unique shareable link viewable on your own example.com domain as follows:

    1. Get URL of the File (Image document etc).

    2. Add this URL to the end of the domain name responsible for showcasing the file e.g: example.com/pdfviewer

    3. Get the current route. Extract the later part (downloadable url).

    4. Use this url part to show the document.

    Good Luck!