Removed the IOS guard for the Download feature.

Enabled the UISupportsDocumentBrowser IOS option so that the App Documents are visible for other apps.
This commit is contained in:
Iulian Ciorascu
2023-02-11 00:55:23 +01:00
parent d7cbe40395
commit f504c4908c
2 changed files with 10 additions and 9 deletions

View File

@@ -66,6 +66,8 @@
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
<true/>
<key>UISupportsDocumentBrowser</key>
<true/>
</dict>
</plist>

View File

@@ -37,20 +37,19 @@ class _DocumentDownloadButtonState extends State<DocumentDownloadButton> {
width: 16,
)
: const Icon(Icons.download),
onPressed: Platform.isAndroid && widget.document != null && widget.enabled
onPressed: widget.document != null && widget.enabled
? () => _onDownload(widget.document!)
: null,
).paddedOnly(right: 4);
}
Future<void> _onDownload(DocumentModel document) async {
if (!Platform.isAndroid) {
showSnackBar(
context, "This feature is currently only supported on Android!");
return;
}
if (true) {
// should check for android versions < 30
// if (!Platform.isAndroid) {
// showSnackBar(
// context, "This feature is currently only supported on Android!");
// return;
// }
if (Platform.isAndroid && androidInfo!.version.sdkInt! < 30) {
final isGranted = await askForPermission(Permission.storage);
if (!isGranted) {
return;