Fixed saved view model, slightly changed sorting dialog, fixed open document in system viewer not working because file has folder-like structure.

This commit is contained in:
Anton Stubenbord
2023-01-21 22:33:42 +01:00
parent a5e19fc0b4
commit 1aeebca96b
10 changed files with 182 additions and 219 deletions

View File

@@ -53,7 +53,8 @@ class DocumentDetailsCubit extends Cubit<DocumentDetailsState> {
final metaData = await _api.getMetaData(state.document);
final docBytes = await _api.download(state.document);
File f = File('${downloadDir.path}/${metaData.mediaFilename}');
f.writeAsBytes(docBytes);
f.createSync(recursive: true);
f.writeAsBytesSync(docBytes);
return OpenFilex.open(f.path, type: "application/pdf")
.then((value) => value.type);
}