Skip to content

Commit 7635c18

Browse files
committed
Update iOS example files
1 parent 85113bb commit 7635c18

File tree

17 files changed

+212
-254
lines changed

17 files changed

+212
-254
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- Modify this file to customize your launch splash screen -->
3+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
4+
<item android:drawable="?android:colorBackground" />
5+
6+
<!-- You can insert your own image assets here -->
7+
<!-- <item>
8+
<bitmap
9+
android:gravity="center"
10+
android:src="@mipmap/launch_image" />
11+
</item> -->
12+
</layer-list>

example/ios/.gitignore

Lines changed: 26 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,32 @@
1-
.idea/
2-
.vagrant/
3-
.sconsign.dblite
4-
.svn/
5-
6-
.DS_Store
7-
*.swp
8-
profile
9-
10-
DerivedData/
11-
build/
12-
GeneratedPluginRegistrant.h
13-
GeneratedPluginRegistrant.m
14-
15-
*.pbxuser
161
*.mode1v3
172
*.mode2v3
3+
*.moved-aside
4+
*.pbxuser
185
*.perspectivev3
19-
20-
!default.pbxuser
6+
**/*sync/
7+
.sconsign.dblite
8+
.tags*
9+
**/.vagrant/
10+
**/DerivedData/
11+
Icon?
12+
**/Pods/
13+
**/.symlinks/
14+
profile
15+
xcuserdata
16+
**/.generated/
17+
Flutter/App.framework
18+
Flutter/Flutter.framework
19+
Flutter/Flutter.podspec
20+
Flutter/Generated.xcconfig
21+
Flutter/app.flx
22+
Flutter/app.zip
23+
Flutter/flutter_assets/
24+
Flutter/flutter_export_environment.sh
25+
ServiceDefinitions.json
26+
Runner/GeneratedPluginRegistrant.*
27+
28+
# Exceptions to above rules.
2129
!default.mode1v3
2230
!default.mode2v3
31+
!default.pbxuser
2332
!default.perspectivev3
24-
25-
xcuserdata
26-
27-
*.moved-aside
28-
29-
*.pyc
30-
*sync/
31-
Icon?
32-
.tags*
33-
34-
/Flutter/app.flx
35-
/Flutter/app.zip
36-
/Flutter/flutter_assets/
37-
/Flutter/App.framework
38-
/Flutter/Flutter.framework
39-
/Flutter/Generated.xcconfig
40-
/ServiceDefinitions.json
41-
42-
Pods/

example/ios/Flutter/AppFrameworkInfo.plist

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@
2020
<string>????</string>
2121
<key>CFBundleVersion</key>
2222
<string>1.0</string>
23-
<key>UIRequiredDeviceCapabilities</key>
24-
<array>
25-
<string>arm64</string>
26-
</array>
2723
<key>MinimumOSVersion</key>
2824
<string>8.0</string>
2925
</dict>

example/ios/Flutter/Debug.xcconfig

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

example/ios/Flutter/Release.xcconfig

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

example/ios/Podfile

Lines changed: 26 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -4,51 +4,38 @@
44
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
55
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
66

7-
def parse_KV_file(file,seperator='=')
8-
file_abs_path = File.expand_path(file)
9-
if !File.exists? file_abs_path
10-
return [];
7+
project 'Runner', {
8+
'Debug' => :debug,
9+
'Profile' => :release,
10+
'Release' => :release,
11+
}
12+
13+
def flutter_root
14+
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
15+
unless File.exist?(generated_xcode_build_settings_path)
16+
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
17+
end
18+
19+
File.foreach(generated_xcode_build_settings_path) do |line|
20+
matches = line.match(/FLUTTER_ROOT\=(.*)/)
21+
return matches[1].strip if matches
1122
end
12-
pods_ary = []
13-
skip_line_start_symbols = ["#", "/"]
14-
File.foreach(file_abs_path) { |line|
15-
next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
16-
plugin = line.split(pattern=seperator)
17-
if plugin.length == 2
18-
podname = plugin[0].strip()
19-
path = plugin[1].strip()
20-
podpath = File.expand_path("#{path}", file_abs_path)
21-
pods_ary.push({:name => podname,:path=>podpath});
22-
else
23-
puts "Invalid plugin specification: #{line}"
24-
end
25-
}
26-
return pods_ary
23+
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
2724
end
2825

26+
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
27+
28+
flutter_ios_podfile_setup
29+
2930
target 'Runner' do
30-
# Flutter Pods
31-
generated_xcode_build_settings = parse_KV_file("./Flutter/Generated.xcconfig")
32-
if generated_xcode_build_settings.empty?
33-
puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter build or flutter run is executed once first."
34-
end
35-
generated_xcode_build_settings.map{ |p|
36-
if p[:name]=='FLUTTER_FRAMEWORK_DIR'
37-
pod 'Flutter', :path => p[:path]
38-
end
39-
}
40-
41-
# Plugin Pods
42-
plugin_pods = parse_KV_file("../.flutter-plugins")
43-
plugin_pods.map{ |p|
44-
pod p[:name], :path => File.expand_path("ios",p[:path])
45-
}
31+
use_frameworks!
32+
use_modular_headers!
33+
34+
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
4635
end
4736

4837
post_install do |installer|
4938
installer.pods_project.targets.each do |target|
50-
target.build_configurations.each do |config|
51-
config.build_settings['ENABLE_BITCODE'] = 'NO'
52-
end
39+
flutter_additional_ios_build_settings(target)
5340
end
54-
end
41+
end

example/ios/Podfile.lock

Lines changed: 0 additions & 37 deletions
This file was deleted.

0 commit comments

Comments
 (0)