# open_document
**Repository Path**: deepnas/open_document
## Basic Information
- **Project Name**: open_document
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: MIT
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2024-07-31
- **Last Updated**: 2024-07-31
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# open_document
Used to create a folder on the user's mobile phone and Desktop;
- Android stays inside documents with the name of your app
- iOs is in your app's name files
- Windows Documents
---
## Opening pdf, xlsx, docs, ppt and zip files
---
## Getting Started
***Android ->> config res -> create folder -> xml -> create provider_paths.xml***
---
***Add AndroidManifest :***
---
***iOs config -> info.plist Add***
Create folder em Document
LSSupportsOpeningDocumentsInPlace
### USED ->
final name = await OpenDocument.getNameFile(url: url);
final path = await OpenDocument.getPathDocument();
filePath = "$path/$name";
final isCheck = await OpenDocument.checkDocument(filePath: filePath);
try {
if (!isCheck) {
filePath = await downloadFile(filePath: "$filePath", url: url);
}
await OpenDocument.openDocument(filePath: filePath);
} on OpenDocumentException catch (e) {
debugPrint("ERROR: ${e.errorMessage}");
filePath = 'Failed to get platform version.';
}
Future downloadFile({String filePath, String url}) async {
// CancelToken cancelToken = CancelToken();
Dio dio = new Dio();
await dio.download(
url,
filePath,
onReceiveProgress: (count, total) {
debugPrint('---Download----Rec: $count, Total: $total');
setState(() {
_platformVersion = ((count / total) * 100).toStringAsFixed(0) + "%";
});
},
);
return filePath;
}
## How to access the folder created with the files and view and delete:
With ***StyleFile*** you can change some settings
of Viewing Your Screen with Your Files
### StyleMyFile.elevatedButtonText = "Compartilhar";
***Call preview screen***
---
pushScreen() async {
String name = await OpenDocument.getNameFolder();
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => MyFilesScreen(filePath: name),
),
);
}
---
