简体   繁体   中英

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??

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM