Skip to content

Commit e7fcd85

Browse files
committed
multiplatform filepicker
1 parent 52fbcbc commit e7fcd85

31 files changed

+601
-82
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ just_audio/
3737
.packages
3838
.pub-cache/
3939
.pub/
40-
/build/
40+
build/
4141

4242
# Web related
4343

ios/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Uncomment this line to define a global platform for your project
2-
platform :ios, '10.0'
2+
platform :ios, '12.0'
33

44
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
55
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

ios/Podfile.lock

Lines changed: 36 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ PODS:
77
- Flutter
88
- device_info_plus (0.0.1):
99
- Flutter
10+
- file_picker (0.0.1):
11+
- Flutter
1012
- Flutter (1.0.0)
1113
- flutter_audio_query (0.0.1):
1214
- Flutter
@@ -22,20 +24,25 @@ PODS:
2224
- Flutter
2325
- just_audio (0.0.1):
2426
- Flutter
27+
- mighty_ble (0.0.1):
28+
- Flutter
2529
- package_info_plus (0.4.5):
2630
- Flutter
27-
- path_provider_ios (0.0.1):
31+
- path_provider_foundation (0.0.1):
2832
- Flutter
29-
- "permission_handler (5.1.0+2)":
33+
- FlutterMacOS
34+
- permission_handler_apple (9.0.4):
3035
- Flutter
31-
- Protobuf (3.21.9)
36+
- Protobuf (3.22.1)
3237
- qr_utils (0.1.5):
3338
- Flutter
34-
- Sentry/HybridSDK (7.30.2)
39+
- Sentry/HybridSDK (8.3.3):
40+
- SentryPrivate (= 8.3.3)
3541
- sentry_flutter (0.0.1):
3642
- Flutter
3743
- FlutterMacOS
38-
- Sentry/HybridSDK (= 7.30.2)
44+
- Sentry/HybridSDK (= 8.3.3)
45+
- SentryPrivate (8.3.3)
3946
- share_plus (0.0.1):
4047
- Flutter
4148
- url_launcher_ios (0.0.1):
@@ -48,15 +55,17 @@ DEPENDENCIES:
4855
- audio_session (from `.symlinks/plugins/audio_session/ios`)
4956
- audio_waveform (from `.symlinks/plugins/audio_waveform/ios`)
5057
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
58+
- file_picker (from `.symlinks/plugins/file_picker/ios`)
5159
- Flutter (from `Flutter`)
5260
- flutter_audio_query (from `.symlinks/plugins/flutter_audio_query/ios`)
5361
- flutter_blue_plus (from `.symlinks/plugins/flutter_blue_plus/ios`)
5462
- flutter_keyboard_visibility (from `.symlinks/plugins/flutter_keyboard_visibility/ios`)
5563
- flutter_midi_command (from `.symlinks/plugins/flutter_midi_command/ios`)
5664
- just_audio (from `.symlinks/plugins/just_audio/ios`)
65+
- mighty_ble (from `.symlinks/plugins/mighty_ble/ios`)
5766
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
58-
- path_provider_ios (from `.symlinks/plugins/path_provider_ios/ios`)
59-
- permission_handler (from `.symlinks/plugins/permission_handler/ios`)
67+
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/ios`)
68+
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
6069
- qr_utils (from `.symlinks/plugins/qr_utils/ios`)
6170
- sentry_flutter (from `.symlinks/plugins/sentry_flutter/ios`)
6271
- share_plus (from `.symlinks/plugins/share_plus/ios`)
@@ -67,6 +76,7 @@ SPEC REPOS:
6776
trunk:
6877
- Protobuf
6978
- Sentry
79+
- SentryPrivate
7080

7181
EXTERNAL SOURCES:
7282
audio_picker:
@@ -77,6 +87,8 @@ EXTERNAL SOURCES:
7787
:path: ".symlinks/plugins/audio_waveform/ios"
7888
device_info_plus:
7989
:path: ".symlinks/plugins/device_info_plus/ios"
90+
file_picker:
91+
:path: ".symlinks/plugins/file_picker/ios"
8092
Flutter:
8193
:path: Flutter
8294
flutter_audio_query:
@@ -89,12 +101,14 @@ EXTERNAL SOURCES:
89101
:path: ".symlinks/plugins/flutter_midi_command/ios"
90102
just_audio:
91103
:path: ".symlinks/plugins/just_audio/ios"
104+
mighty_ble:
105+
:path: ".symlinks/plugins/mighty_ble/ios"
92106
package_info_plus:
93107
:path: ".symlinks/plugins/package_info_plus/ios"
94-
path_provider_ios:
95-
:path: ".symlinks/plugins/path_provider_ios/ios"
96-
permission_handler:
97-
:path: ".symlinks/plugins/permission_handler/ios"
108+
path_provider_foundation:
109+
:path: ".symlinks/plugins/path_provider_foundation/ios"
110+
permission_handler_apple:
111+
:path: ".symlinks/plugins/permission_handler_apple/ios"
98112
qr_utils:
99113
:path: ".symlinks/plugins/qr_utils/ios"
100114
sentry_flutter:
@@ -111,23 +125,26 @@ SPEC CHECKSUMS:
111125
audio_session: 4f3e461722055d21515cf3261b64c973c062f345
112126
audio_waveform: 752f745d2fa83aa1171f18255db1395e278317ce
113127
device_info_plus: e5c5da33f982a436e103237c0c85f9031142abed
128+
file_picker: 088e1a97eb2ed66964279fe39013ab8f23022a4d
114129
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
115130
flutter_audio_query: 45f1076a639975e198f4e822ac2c5e6e65b20f89
116131
flutter_blue_plus: 6787777145d615de01828f3a9fa423c3c702f0b3
117132
flutter_keyboard_visibility: 0339d06371254c3eb25eeb90ba8d17dca8f9c069
118133
flutter_midi_command: 4acc18c6391c574d21f1d3a1cc40c7fe06ff461f
119134
just_audio: baa7252489dbcf47a4c7cc9ca663e9661c99aafa
135+
mighty_ble: 86cf1fc1c314039c8675fb5fba9f2a4ec96d710c
120136
package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e
121-
path_provider_ios: 14f3d2fd28c4fdb42f44e0f751d12861c43cee02
122-
permission_handler: ccb20a9fad0ee9b1314a52b70b76b473c5f8dab0
123-
Protobuf: 02524ec14183fe08fb259741659e79683788158b
137+
path_provider_foundation: c68054786f1b4f3343858c1e1d0caaded73f0be9
138+
permission_handler_apple: 44366e37eaf29454a1e7b1b7d736c2cceaeb17ce
139+
Protobuf: d7f7c8329edf5eb8af65547a8ba3e9c1cee927d5
124140
qr_utils: f8364c024ea259dfe0d88d4ba4f7b34984b7a61f
125-
Sentry: 9be48e341494bc976c963b05aa4a8ca48308c684
126-
sentry_flutter: 544e6376e35b00eef9f0864f8bb7f10a0e204993
141+
Sentry: 8ffc397d98fe58d693e73959b26ed0eaee55646a
142+
sentry_flutter: 5028afacfa875785cb0e3682aece171fcd9dc0d5
143+
SentryPrivate: bf776a47a131648f5023097215987b40fbd47025
127144
share_plus: 056a1e8ac890df3e33cb503afffaf1e9b4fbae68
128-
url_launcher_ios: 839c58cdb4279282219f5e248c3321761ff3c4de
145+
url_launcher_ios: 08a3dfac5fb39e8759aeb0abbd5d9480f30fc8b4
129146
wakelock: d0fc7c864128eac40eba1617cb5264d9c940b46f
130147

131-
PODFILE CHECKSUM: fe0e1ee7f3d1f7d00b11b474b62dd62134535aea
148+
PODFILE CHECKSUM: 4e8f8b2be68aeea4c0d5beb6ff1e79fface1d048
132149

133-
COCOAPODS: 1.11.3
150+
COCOAPODS: 1.12.0

ios/Runner.xcodeproj/project.pbxproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 51;
6+
objectVersion = 54;
77
objects = {
88

99
/* Begin PBXBuildFile section */
@@ -201,6 +201,7 @@
201201
/* Begin PBXShellScriptBuildPhase section */
202202
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
203203
isa = PBXShellScriptBuildPhase;
204+
alwaysOutOfDate = 1;
204205
buildActionMask = 2147483647;
205206
files = (
206207
);
@@ -237,6 +238,7 @@
237238
};
238239
9740EEB61CF901F6004384FC /* Run Script */ = {
239240
isa = PBXShellScriptBuildPhase;
241+
alwaysOutOfDate = 1;
240242
buildActionMask = 2147483647;
241243
files = (
242244
);

ios/Runner/Info.plist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,11 @@
6161
<string>This app uses camera to scan QR codes that contain preset data for the connected amplifier</string>
6262
<key>NSPhotoLibraryUsageDescription</key>
6363
<string>This app wants to use your photos.</string>
64+
<key>NSFileProviderDomainUsageDescription</key>
65+
<string>Mightier Amp needs files access to let you backup your presets.</string>
6466
<key>CADisableMinimumFrameDurationOnPhone</key>
6567
<true/>
68+
<key>UIApplicationSupportsIndirectInputEvents</key>
69+
<true/>
6670
</dict>
6771
</plist>

lib/UI/widgets/presets/presetList.dart

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import 'package:drag_and_drop_lists/drag_and_drop_list_interface.dart';
22
import 'package:drag_and_drop_lists/drag_and_drop_lists.dart';
3+
import 'package:file_picker/file_picker.dart';
34
import 'package:flutter/foundation.dart';
45
import 'package:flutter/material.dart';
56
import 'package:mighty_plug_manager/UI/toneshare/toneshare_main.dart';
@@ -101,20 +102,20 @@ class _PresetListState extends State<PresetList>
101102
],
102103
),
103104
),
104-
if (!PlatformUtils.isIOS)
105-
PopupMenuItem(
106-
value: CategoryMenuActions.Export,
107-
child: Row(
108-
children: <Widget>[
109-
Icon(
110-
Icons.save_alt,
111-
color: AppThemeConfig.contextMenuIconColor,
112-
),
113-
const SizedBox(width: 5),
114-
const Text("Export Category"),
115-
],
116-
),
117-
)
105+
//if (!PlatformUtils.isIOS)
106+
PopupMenuItem(
107+
value: CategoryMenuActions.Export,
108+
child: Row(
109+
children: <Widget>[
110+
Icon(
111+
Icons.save_alt,
112+
color: AppThemeConfig.contextMenuIconColor,
113+
),
114+
const SizedBox(width: 5),
115+
const Text("Export Category"),
116+
],
117+
),
118+
)
118119
];
119120

120121
NuxDevice get device => NuxDeviceControl.instance().device;
@@ -453,7 +454,10 @@ class _PresetListState extends State<PresetList>
453454
String? data = PresetsStorage().presetsToJson(category);
454455

455456
if (data != null) {
456-
saveFileString("application/octet-stream", "$category.nuxpreset", data);
457+
if (!PlatformUtils.isIOS)
458+
saveFileString("application/octet-stream", "$category.nuxpreset", data);
459+
else
460+
FilePicker()..saveFile(data);
457461
} else {
458462
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
459463
backgroundColor: Colors.deepOrange,

plugins/file_picker/.gitignore

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Miscellaneous
2+
*.class
3+
*.log
4+
*.pyc
5+
*.swp
6+
.DS_Store
7+
.atom/
8+
.buildlog/
9+
.history
10+
.svn/
11+
migrate_working_dir/
12+
13+
# IntelliJ related
14+
*.iml
15+
*.ipr
16+
*.iws
17+
.idea/
18+
19+
# The .vscode folder contains launch configuration and tasks you configure in
20+
# VS Code which you may wish to be included in version control, so this line
21+
# is commented out by default.
22+
#.vscode/
23+
24+
# Flutter/Dart/Pub related
25+
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
26+
/pubspec.lock
27+
**/doc/api/
28+
.dart_tool/
29+
.packages
30+
build/

plugins/file_picker/.metadata

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# This file tracks properties of this Flutter project.
2+
# Used by Flutter tool to assess capabilities and perform upgrades etc.
3+
#
4+
# This file should be version controlled.
5+
6+
version:
7+
revision: 52b3dc25f6471c27b2144594abb11c741cb88f57
8+
channel: stable
9+
10+
project_type: plugin
11+
12+
# Tracks metadata for the flutter migrate command
13+
migration:
14+
platforms:
15+
- platform: root
16+
create_revision: 52b3dc25f6471c27b2144594abb11c741cb88f57
17+
base_revision: 52b3dc25f6471c27b2144594abb11c741cb88f57
18+
- platform: android
19+
create_revision: 52b3dc25f6471c27b2144594abb11c741cb88f57
20+
base_revision: 52b3dc25f6471c27b2144594abb11c741cb88f57
21+
- platform: ios
22+
create_revision: 52b3dc25f6471c27b2144594abb11c741cb88f57
23+
base_revision: 52b3dc25f6471c27b2144594abb11c741cb88f57
24+
25+
# User provided section
26+
27+
# List of Local paths (relative to this file) that should be
28+
# ignored by the migrate tool.
29+
#
30+
# Files that are not part of the templates will be ignored by default.
31+
unmanaged_files:
32+
- 'lib/main.dart'
33+
- 'ios/Runner.xcodeproj/project.pbxproj'

plugins/file_picker/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## 0.0.1
2+
3+
* TODO: Describe initial release.

plugins/file_picker/LICENSE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
TODO: Add your license here.

0 commit comments

Comments
 (0)