Skip to content

Commit

Permalink
Remove file_picker
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbengtsson committed Sep 1, 2024
1 parent b628dcd commit 698f7d2
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 88 deletions.
54 changes: 5 additions & 49 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,39 +1,7 @@
PODS:
- device_info_plus (0.0.1):
- Flutter
- DKImagePickerController/Core (4.3.9):
- DKImagePickerController/ImageDataManager
- DKImagePickerController/Resource
- DKImagePickerController/ImageDataManager (4.3.9)
- DKImagePickerController/PhotoGallery (4.3.9):
- DKImagePickerController/Core
- DKPhotoGallery
- DKImagePickerController/Resource (4.3.9)
- DKPhotoGallery (0.0.19):
- DKPhotoGallery/Core (= 0.0.19)
- DKPhotoGallery/Model (= 0.0.19)
- DKPhotoGallery/Preview (= 0.0.19)
- DKPhotoGallery/Resource (= 0.0.19)
- SDWebImage
- SwiftyGif
- DKPhotoGallery/Core (0.0.19):
- DKPhotoGallery/Model
- DKPhotoGallery/Preview
- SDWebImage
- SwiftyGif
- DKPhotoGallery/Model (0.0.19):
- SDWebImage
- SwiftyGif
- DKPhotoGallery/Preview (0.0.19):
- DKPhotoGallery/Model
- DKPhotoGallery/Resource
- SDWebImage
- SwiftyGif
- DKPhotoGallery/Resource (0.0.19):
- SDWebImage
- SwiftyGif
- file_picker (0.0.1):
- DKImagePickerController/PhotoGallery
- file_selector_ios (0.0.1):
- Flutter
- Flutter (1.0.0)
- flutter_webrtc (0.11.3):
Expand All @@ -52,9 +20,6 @@ PODS:
- Flutter
- receive_sharing_intent (1.8.0):
- Flutter
- SDWebImage (5.19.7):
- SDWebImage/Core (= 5.19.7)
- SDWebImage/Core (5.19.7)
- Sentry/HybridSDK (8.35.1)
- sentry_flutter (8.8.0):
- Flutter
Expand All @@ -65,7 +30,6 @@ PODS:
- shared_preferences_foundation (0.0.1):
- Flutter
- FlutterMacOS
- SwiftyGif (5.4.5)
- url_launcher_ios (0.0.1):
- Flutter
- wakelock (0.0.1):
Expand All @@ -74,7 +38,7 @@ PODS:

DEPENDENCIES:
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
- file_picker (from `.symlinks/plugins/file_picker/ios`)
- file_selector_ios (from `.symlinks/plugins/file_selector_ios/ios`)
- Flutter (from `Flutter`)
- flutter_webrtc (from `.symlinks/plugins/flutter_webrtc/ios`)
- integration_test (from `.symlinks/plugins/integration_test/ios`)
Expand All @@ -91,18 +55,14 @@ DEPENDENCIES:

SPEC REPOS:
trunk:
- DKImagePickerController
- DKPhotoGallery
- SDWebImage
- Sentry
- SwiftyGif
- WebRTC-SDK

EXTERNAL SOURCES:
device_info_plus:
:path: ".symlinks/plugins/device_info_plus/ios"
file_picker:
:path: ".symlinks/plugins/file_picker/ios"
file_selector_ios:
:path: ".symlinks/plugins/file_selector_ios/ios"
Flutter:
:path: Flutter
flutter_webrtc:
Expand Down Expand Up @@ -132,9 +92,7 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
device_info_plus: 97af1d7e84681a90d0693e63169a5d50e0839a0d
DKImagePickerController: 946cec48c7873164274ecc4624d19e3da4c1ef3c
DKPhotoGallery: b3834fecb755ee09a593d7c9e389d8b5d6deed60
file_picker: 09aa5ec1ab24135ccd7a1621c46c84134bfd6655
file_selector_ios: f0670c1064a8c8450e38145d8043160105d0b97c
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
flutter_webrtc: 75b868e4f9e817c7a9a42ca4b6169063de4eec9f
integration_test: 252f60fa39af5e17c3aa9899d35d908a0721b573
Expand All @@ -143,12 +101,10 @@ SPEC CHECKSUMS:
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
quick_look: 59394001d6b484c13fd5f73b555398d523726c8c
receive_sharing_intent: df9c334dc9feadcbd3266e5cb49c8443405e1c9f
SDWebImage: 8a6b7b160b4d710e2a22b6900e25301075c34cb3
Sentry: 1fe34e9c2cbba1e347623610d26db121dcb569f1
sentry_flutter: a39c2a2d67d5e5b9cb0b94a4985c76dd5b3fc737
share_plus: 8875f4f2500512ea181eef553c3e27dba5135aad
shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4
url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe
wakelock: d0fc7c864128eac40eba1617cb5264d9c940b46f
WebRTC-SDK: c3d69a87e7185fad3568f6f3cff7c9ac5890acf3
Expand Down
9 changes: 3 additions & 6 deletions lib/interface/file_location_dialog.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'dart:io';

import 'package:airdash/model/value_store.dart';
import 'package:file_picker/file_picker.dart';
import 'package:file_selector/file_selector.dart';
import 'package:flutter/material.dart';

import '../helpers.dart';
Expand Down Expand Up @@ -53,11 +53,8 @@ class _FileLocationDialogState extends State<FileLocationDialog> {
const SizedBox(width: 10),
IconButton(
onPressed: () async {
var directoryPath =
await FilePicker.platform.getDirectoryPath(
lockParentWindow: true,
initialDirectory: widget.fileLocationPath,
);
var directoryPath = await getDirectoryPath(
initialDirectory: widget.fileLocationPath);
if (directoryPath != null) {
await widget.valueStore.setFileLocation(directoryPath);
print('Selected $directoryPath');
Expand Down
21 changes: 5 additions & 16 deletions lib/interface/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import 'dart:convert';
import 'dart:io';

import 'package:desktop_drop/desktop_drop.dart';
import 'package:file_picker/file_picker.dart';
import 'package:file_selector/file_selector.dart';
import 'package:firedart/firedart.dart';
import 'package:flutter/foundation.dart';
Expand Down Expand Up @@ -542,15 +541,15 @@ class HomeScreenState extends ConsumerState<HomeScreen>
title: const Text('Media'),
onTap: () async {
Navigator.of(context).pop();
openFilePicker(FileType.media);
openFilePicker(true);
},
),
ListTile(
leading: const Icon(Icons.description),
title: const Text('Files'),
onTap: () async {
Navigator.of(context).pop();
openFilePicker(FileType.any);
openFilePicker(false);
},
),
],
Expand All @@ -559,23 +558,13 @@ class HomeScreenState extends ConsumerState<HomeScreen>
});
}

Future<void> openFilePicker(FileType type) async {
Future<void> openFilePicker(bool mediaOnly) async {
isPickingFile = true;
var result = await openFiles();

// Required zenity on linux which was complicated to use with snaps
// var result = await FilePicker.platform.pickFiles(
// dialogTitle: 'Pick File',
// type: type,
// lockParentWindow: true,
// withData: false,
// allowCompression: false,
// withReadStream: true,
// allowMultiple: true,
// );
if (result.isNotEmpty) {
var files = result.map((it) => File(it.path!)).toList();
var param = type == FileType.media ? 'media' : 'fileManager';
var param = mediaOnly ? 'media' : 'fileManager';
await setPayload(FilePayload(files), param);
logger('HOME: File selected ${files.length}');
}
Expand Down Expand Up @@ -767,7 +756,7 @@ class HomeScreenState extends ConsumerState<HomeScreen>
if (Platform.isIOS) {
openPhotoAndFileBottomSheet();
} else {
openFilePicker(FileType.any);
openFilePicker(false);
}
}

Expand Down
16 changes: 0 additions & 16 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -222,14 +222,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "7.0.0"
file_picker:
dependency: "direct main"
description:
name: file_picker
sha256: "167bb619cdddaa10ef2907609feb8a79c16dfa479d3afaf960f8e223f754bf12"
url: "https://pub.dev"
source: hosted
version: "8.1.2"
file_selector:
dependency: "direct main"
description:
Expand Down Expand Up @@ -328,14 +320,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.0.2"
flutter_plugin_android_lifecycle:
dependency: transitive
description:
name: flutter_plugin_android_lifecycle
sha256: "9ee02950848f61c4129af3d6ec84a1cfc0e47931abc746b03e7a3bc3e8ff6eda"
url: "https://pub.dev"
source: hosted
version: "2.0.22"
flutter_riverpod:
dependency: "direct main"
description:
Expand Down
1 change: 0 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ dependencies:
cupertino_icons: ^1.0.2
flutter_webrtc: ^0.11.0
http: ^1.2.1
file_picker: ^8.0.3
path_provider: ^2.0.12
share_plus: ^10.0.0
shared_preferences: ^2.0.15
Expand Down

0 comments on commit 698f7d2

Please sign in to comment.