n8bour
n8bour

Reputation: 1159

How i download/display a file(pdf/ppt/docx) in flutter app?

im getting a file from a repository in the web, and i want to download or if possible without downloading display/open it (in case of display be open remotely), if i have to download it, it do it as well xD, but my question is, the body i cant to nothing possible, so i have to check content-type form header on the response and probably the bodyBytes??

var reply;
   var url = '$host/repositoryStream/$id?BACOSESS=$bacosess';  
      var response = await http.get(url);

      if ( response.statusCode == HttpStatus.OK)
        reply = response;

what do i do with the bytes or the body to open it in the phone??

Upvotes: 0

Views: 7093

Answers (1)

n8bour
n8bour

Reputation: 1159

for those who still don't know there is a plugin very handy, it works for me. open_file you still have to request/check permissions with simple_permissions.

i hope this would help the guys who have been waiting for this.

Upvotes: 1

Related Questions