How to open and PDF or word document in the [Flutter]

前端 未结 6 1180
别那么骄傲
别那么骄傲 2020-12-16 13:01

Question is simple, I would like to open any pdf or doc file via default App with using Flutter.

Think a Raised button that related my pdf asset, when user press it

6条回答
  •  春和景丽
    2020-12-16 13:41

    A good and simple approach to this is the open_file package which lets you open a file with the given path. It supports numerous different file types:

    import 'package:open_file/open_file.dart';
    
    OpenFile.open("/sdcard/example.pdf");
    

提交回复
热议问题