Skip to content

Commit f884e84

Browse files
committed
Set up example app
1 parent 522aed9 commit f884e84

File tree

11 files changed

+314
-139
lines changed

11 files changed

+314
-139
lines changed

example/android/app/src/main/AndroidManifest.xml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
22
package="dev.formbuilderfilepicker.example">
33

4-
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
5-
calls FlutterMain.startInitialization(this); in its onCreate method.
6-
In most cases you can leave this as-is, but you if you want to provide
7-
additional functionality it is fine to subclass or reimplement
8-
FlutterApplication and put your custom class here. -->
4+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
5+
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
6+
<uses-permission android:name="android.permission.CAMERA" />
97
<application
108
android:name="io.flutter.app.FlutterApplication"
119
android:label="example"

example/ios/Flutter/Debug.xcconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
12
#include "Generated.xcconfig"

example/ios/Flutter/Release.xcconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
12
#include "Generated.xcconfig"

example/ios/Podfile

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Uncomment this line to define a global platform for your project
2+
platform :ios, '9.0'
3+
4+
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
5+
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
6+
7+
project 'Runner', {
8+
'Debug' => :debug,
9+
'Profile' => :release,
10+
'Release' => :release,
11+
}
12+
13+
def parse_KV_file(file, separator='=')
14+
file_abs_path = File.expand_path(file)
15+
if !File.exists? file_abs_path
16+
return [];
17+
end
18+
pods_ary = []
19+
skip_line_start_symbols = ["#", "/"]
20+
File.foreach(file_abs_path) { |line|
21+
next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
22+
plugin = line.split(pattern=separator)
23+
if plugin.length == 2
24+
podname = plugin[0].strip()
25+
path = plugin[1].strip()
26+
podpath = File.expand_path("#{path}", file_abs_path)
27+
pods_ary.push({:name => podname, :path => podpath});
28+
else
29+
puts "Invalid plugin specification: #{line}"
30+
end
31+
}
32+
return pods_ary
33+
end
34+
35+
target 'Runner' do
36+
use_frameworks!
37+
38+
# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
39+
# referring to absolute paths on developers' machines.
40+
system('rm -rf .symlinks')
41+
system('mkdir -p .symlinks/plugins')
42+
43+
# Flutter Pods
44+
generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig')
45+
if generated_xcode_build_settings.empty?
46+
puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first."
47+
end
48+
generated_xcode_build_settings.map { |p|
49+
if p[:name] == 'FLUTTER_FRAMEWORK_DIR'
50+
symlink = File.join('.symlinks', 'flutter')
51+
File.symlink(File.dirname(p[:path]), symlink)
52+
pod 'Flutter', :path => File.join(symlink, File.basename(p[:path]))
53+
end
54+
}
55+
56+
# Plugin Pods
57+
plugin_pods = parse_KV_file('../.flutter-plugins')
58+
plugin_pods.map { |p|
59+
symlink = File.join('.symlinks', 'plugins', p[:name])
60+
File.symlink(p[:path], symlink)
61+
pod p[:name], :path => File.join(symlink, 'ios')
62+
}
63+
end
64+
65+
# Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system.
66+
install! 'cocoapods', :disable_input_output_paths => true
67+
68+
post_install do |installer|
69+
installer.pods_project.targets.each do |target|
70+
target.build_configurations.each do |config|
71+
config.build_settings['ENABLE_BITCODE'] = 'NO'
72+
end
73+
end
74+
end

example/ios/Podfile.lock

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
PODS:
2+
- BSGridCollectionViewLayout (1.2.5)
3+
- BSImagePicker (2.10.3):
4+
- BSGridCollectionViewLayout (= 1.2.5)
5+
- BSImageView (= 1.0.3)
6+
- BSImageView (1.0.3)
7+
- file_picker (0.0.1):
8+
- Flutter
9+
- Flutter (1.0.0)
10+
- flutter_keyboard_visibility (0.7.0):
11+
- Flutter
12+
- multi_image_picker (4.5.9):
13+
- BSImagePicker (~> 2.10.3)
14+
- Flutter
15+
- permission_handler (4.0.0):
16+
- Flutter
17+
18+
DEPENDENCIES:
19+
- file_picker (from `.symlinks/plugins/file_picker/ios`)
20+
- Flutter (from `.symlinks/flutter/ios`)
21+
- flutter_keyboard_visibility (from `.symlinks/plugins/flutter_keyboard_visibility/ios`)
22+
- multi_image_picker (from `.symlinks/plugins/multi_image_picker/ios`)
23+
- permission_handler (from `.symlinks/plugins/permission_handler/ios`)
24+
25+
SPEC REPOS:
26+
trunk:
27+
- BSGridCollectionViewLayout
28+
- BSImagePicker
29+
- BSImageView
30+
31+
EXTERNAL SOURCES:
32+
file_picker:
33+
:path: ".symlinks/plugins/file_picker/ios"
34+
Flutter:
35+
:path: ".symlinks/flutter/ios"
36+
flutter_keyboard_visibility:
37+
:path: ".symlinks/plugins/flutter_keyboard_visibility/ios"
38+
multi_image_picker:
39+
:path: ".symlinks/plugins/multi_image_picker/ios"
40+
permission_handler:
41+
:path: ".symlinks/plugins/permission_handler/ios"
42+
43+
SPEC CHECKSUMS:
44+
BSGridCollectionViewLayout: 333dcb457a5a3bdd9212607ab5756553dcfe06cb
45+
BSImagePicker: 07404254f2fcdaf5a2eb403c0f8c337267ce8738
46+
BSImageView: a149459433a2687157d034c78e059d30ac7f2544
47+
file_picker: 408623be2125b79a4539cf703be3d4b3abe5e245
48+
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
49+
flutter_keyboard_visibility: 6195387fb6d8f46e5cd6dda4a4154e41f800f545
50+
multi_image_picker: 68d86c3e3616a64096cb5ef46de9a8195930a3e4
51+
permission_handler: 0fb88b8a3c23e31e5de45b8f1bb8b7de28cf8941
52+
53+
PODFILE CHECKSUM: 2c26e2bafa90f053205a9e99ab1fdce88251e293
54+
55+
COCOAPODS: 1.8.4

example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
1919
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
2020
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
21+
C31F94CEB23C7232A08A1C1D /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5B2DCCD5D449D2230FCFBCF1 /* Pods_Runner.framework */; };
2122
/* End PBXBuildFile section */
2223

2324
/* Begin PBXCopyFilesBuildPhase section */
@@ -40,6 +41,7 @@
4041
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
4142
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
4243
3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = "<group>"; };
44+
5B2DCCD5D449D2230FCFBCF1 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
4345
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
4446
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
4547
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
@@ -51,6 +53,9 @@
5153
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
5254
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
5355
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
56+
9A0A7F33C663E5245687DE15 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
57+
A0B698C22B4C94F21D65869A /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
58+
A9D1BEA2A39423BFE2CF89D7 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
5459
/* End PBXFileReference section */
5560

5661
/* Begin PBXFrameworksBuildPhase section */
@@ -60,12 +65,21 @@
6065
files = (
6166
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */,
6267
3B80C3941E831B6300D905FE /* App.framework in Frameworks */,
68+
C31F94CEB23C7232A08A1C1D /* Pods_Runner.framework in Frameworks */,
6369
);
6470
runOnlyForDeploymentPostprocessing = 0;
6571
};
6672
/* End PBXFrameworksBuildPhase section */
6773

6874
/* Begin PBXGroup section */
75+
44845B0B74B2F5D3B02E65E1 /* Frameworks */ = {
76+
isa = PBXGroup;
77+
children = (
78+
5B2DCCD5D449D2230FCFBCF1 /* Pods_Runner.framework */,
79+
);
80+
name = Frameworks;
81+
sourceTree = "<group>";
82+
};
6983
9740EEB11CF90186004384FC /* Flutter */ = {
7084
isa = PBXGroup;
7185
children = (
@@ -85,6 +99,8 @@
8599
9740EEB11CF90186004384FC /* Flutter */,
86100
97C146F01CF9000F007C117D /* Runner */,
87101
97C146EF1CF9000F007C117D /* Products */,
102+
BD15487EBB8970678985AB1B /* Pods */,
103+
44845B0B74B2F5D3B02E65E1 /* Frameworks */,
88104
);
89105
sourceTree = "<group>";
90106
};
@@ -119,19 +135,32 @@
119135
name = "Supporting Files";
120136
sourceTree = "<group>";
121137
};
138+
BD15487EBB8970678985AB1B /* Pods */ = {
139+
isa = PBXGroup;
140+
children = (
141+
9A0A7F33C663E5245687DE15 /* Pods-Runner.debug.xcconfig */,
142+
A9D1BEA2A39423BFE2CF89D7 /* Pods-Runner.release.xcconfig */,
143+
A0B698C22B4C94F21D65869A /* Pods-Runner.profile.xcconfig */,
144+
);
145+
name = Pods;
146+
path = Pods;
147+
sourceTree = "<group>";
148+
};
122149
/* End PBXGroup section */
123150

124151
/* Begin PBXNativeTarget section */
125152
97C146ED1CF9000F007C117D /* Runner */ = {
126153
isa = PBXNativeTarget;
127154
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
128155
buildPhases = (
156+
1ED2415A5C260BD9DE1C068D /* [CP] Check Pods Manifest.lock */,
129157
9740EEB61CF901F6004384FC /* Run Script */,
130158
97C146EA1CF9000F007C117D /* Sources */,
131159
97C146EB1CF9000F007C117D /* Frameworks */,
132160
97C146EC1CF9000F007C117D /* Resources */,
133161
9705A1C41CF9048500538489 /* Embed Frameworks */,
134162
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
163+
1463ED95FEBF7C7897230AD0 /* [CP] Embed Pods Frameworks */,
135164
);
136165
buildRules = (
137166
);
@@ -191,6 +220,43 @@
191220
/* End PBXResourcesBuildPhase section */
192221

193222
/* Begin PBXShellScriptBuildPhase section */
223+
1463ED95FEBF7C7897230AD0 /* [CP] Embed Pods Frameworks */ = {
224+
isa = PBXShellScriptBuildPhase;
225+
buildActionMask = 2147483647;
226+
files = (
227+
);
228+
inputPaths = (
229+
);
230+
name = "[CP] Embed Pods Frameworks";
231+
outputPaths = (
232+
);
233+
runOnlyForDeploymentPostprocessing = 0;
234+
shellPath = /bin/sh;
235+
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
236+
showEnvVarsInLog = 0;
237+
};
238+
1ED2415A5C260BD9DE1C068D /* [CP] Check Pods Manifest.lock */ = {
239+
isa = PBXShellScriptBuildPhase;
240+
buildActionMask = 2147483647;
241+
files = (
242+
);
243+
inputFileListPaths = (
244+
);
245+
inputPaths = (
246+
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
247+
"${PODS_ROOT}/Manifest.lock",
248+
);
249+
name = "[CP] Check Pods Manifest.lock";
250+
outputFileListPaths = (
251+
);
252+
outputPaths = (
253+
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
254+
);
255+
runOnlyForDeploymentPostprocessing = 0;
256+
shellPath = /bin/sh;
257+
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
258+
showEnvVarsInLog = 0;
259+
};
194260
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
195261
isa = PBXShellScriptBuildPhase;
196262
buildActionMask = 2147483647;
@@ -513,7 +579,6 @@
513579
defaultConfigurationName = Release;
514580
};
515581
/* End XCConfigurationList section */
516-
517582
};
518583
rootObject = 97C146E61CF9000F007C117D /* Project object */;
519584
}

example/ios/Runner.xcworkspace/contents.xcworkspacedata

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/ios/Runner/Info.plist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,9 @@
4141
</array>
4242
<key>UIViewControllerBasedStatusBarAppearance</key>
4343
<false/>
44+
<key>NSPhotoLibraryUsageDescription</key>
45+
<string>Example usage description</string>
46+
<key>NSCameraUsageDescription</key>
47+
<string>Example usage description</string>
4448
</dict>
4549
</plist>

0 commit comments

Comments
 (0)