diff --git a/app/lib/api/file_system/file_system_io.dart b/app/lib/api/file_system/file_system_io.dart index 41d687eb25cb..fcb4c9a11261 100644 --- a/app/lib/api/file_system/file_system_io.dart +++ b/app/lib/api/file_system/file_system_io.dart @@ -27,6 +27,9 @@ Future getButterflyDirectory([bool root = false]) async { return path; } if (Platform.isAndroid) { + if (path != null) { + path = Uri.tryParse(path)?.toFilePath(); + } path ??= (await getExternalStorageDirectory())?.path; } path ??= (await getApplicationDocumentsDirectory()).path; diff --git a/app/lib/settings/connections.dart b/app/lib/settings/connections.dart index c8f3161691c6..d43dcf3afab7 100644 --- a/app/lib/settings/connections.dart +++ b/app/lib/settings/connections.dart @@ -5,6 +5,7 @@ import 'dart:ui'; import 'package:butterfly/api/open.dart'; import 'package:butterfly/cubits/settings.dart'; import 'package:butterfly/widgets/window.dart'; +import 'package:collection/collection.dart'; import 'package:file_selector/file_selector.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; @@ -56,6 +57,9 @@ class ConnectionsSettingsPage extends StatelessWidget { context: context, title: AppLocalizations.of(context).addConnection, childrenBuilder: (context) => ExternalStorageType.values + .whereNot((e) => + e == ExternalStorageType.local && + Platform.isAndroid) .map((e) => ListTile( title: Text(e.getLocalizedName(context)), leading: PhosphorIcon( diff --git a/app/lib/settings/data.dart b/app/lib/settings/data.dart index f644bba43967..7b45f63e31b8 100644 --- a/app/lib/settings/data.dart +++ b/app/lib/settings/data.dart @@ -1,3 +1,5 @@ +import 'dart:io'; + import 'package:archive/archive.dart'; import 'package:butterfly/api/file_system/file_system_io.dart'; import 'package:butterfly/api/save.dart'; @@ -75,14 +77,17 @@ class _DataSettingsPageState extends State { ) : Text( AppLocalizations.of(context).defaultPath), - onTap: () async { - final settingsCubit = - context.read(); - final selectedDir = await getDirectoryPath(); - if (selectedDir != null) { - _changePath(settingsCubit, selectedDir); - } - }, + onTap: Platform.isAndroid + ? null + : () async { + final settingsCubit = + context.read(); + final selectedDir = + await getDirectoryPath(); + if (selectedDir != null) { + _changePath(settingsCubit, selectedDir); + } + }, trailing: state.documentPath.isNotEmpty ? IconButton( icon: const PhosphorIcon( diff --git a/app/pubspec.lock b/app/pubspec.lock index 159bed20bb85..1037be384093 100644 --- a/app/pubspec.lock +++ b/app/pubspec.lock @@ -172,10 +172,10 @@ packages: dependency: "direct main" description: name: camera - sha256: f3813a634fd1350a9d2a78ee70e5b247cebedc9c58a24560992620e57a8a5600 + sha256: "9499cbc2e51d8eb0beadc158b288380037618ce4e30c9acbc4fae1ac3ecb5797" url: "https://pub.dev" source: hosted - version: "0.10.5+8" + version: "0.10.5+9" camera_android: dependency: transitive description: @@ -397,10 +397,10 @@ packages: dependency: "direct main" description: name: file_selector - sha256: "84eaf3e034d647859167d1f01cfe7b6352488f34c1b4932635012b202014c25b" + sha256: "070062b9fca7482baf60af671219086e188e50dd80497393e7d58532b56215d3" url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "1.0.2" file_selector_android: dependency: transitive description: @@ -895,10 +895,10 @@ packages: dependency: "direct main" description: name: path_provider - sha256: a1aa8aaa2542a6bc57e381f132af822420216c80d4781f7aa085ca3229208aaa + sha256: b27217933eeeba8ff24845c34003b003b2b22151de3c908d0e679e8fe1aa078b url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" path_provider_android: dependency: transitive description: @@ -1310,10 +1310,10 @@ packages: dependency: "direct main" description: name: url_launcher - sha256: e9aa5ea75c84cf46b3db4eea212523591211c3cf2e13099ee4ec147f54201c86 + sha256: d25bb0ca00432a5e1ee40e69c36c85863addf7cc45e433769d61bed3fe81fd96 url: "https://pub.dev" source: hosted - version: "6.2.2" + version: "6.2.3" url_launcher_android: dependency: transitive description: diff --git a/app/pubspec.yaml b/app/pubspec.yaml index b6e8cc77e827..172db6b5cae1 100644 --- a/app/pubspec.yaml +++ b/app/pubspec.yaml @@ -28,10 +28,10 @@ dependencies: flutter_svg: ^2.0.9 flutter_bloc: ^8.1.3 intl: ^0.18.0 - path_provider: ^2.1.1 + path_provider: ^2.1.2 shared_preferences: ^2.2.2 - url_launcher: ^6.2.2 - file_selector: ^1.0.1 + url_launcher: ^6.2.3 + file_selector: ^1.0.2 phosphor_flutter: git: url: https://github.com/CodeDoctorDE/phosphor-flutter @@ -44,7 +44,7 @@ dependencies: xml: ^6.5.0 collection: ^1.18.0 bloc_concurrency: ^0.2.3 - camera: ^0.10.5+8 + camera: ^0.10.5+9 camera_windows: ^0.2.1+9 window_manager: ^0.3.7 flex_color_scheme: ^7.3.1