Skip to content

Commit cb7b7df

Browse files
authored
Enable UIScene Migration and update create templates (flutter#178700)
Reland flutter#178328. ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
1 parent 3a28b6e commit cb7b7df

File tree

16 files changed

+176
-22
lines changed

16 files changed

+176
-22
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CADisableMinimumFrameDurationOnPhone</key>
6+
<true/>
7+
<key>CFBundleDevelopmentRegion</key>
8+
<string>$(DEVELOPMENT_LANGUAGE)</string>
9+
<key>CFBundleDisplayName</key>
10+
<string>Platform Channels Benchmarks</string>
11+
<key>CFBundleExecutable</key>
12+
<string>$(EXECUTABLE_NAME)</string>
13+
<key>CFBundleIdentifier</key>
14+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
15+
<key>CFBundleInfoDictionaryVersion</key>
16+
<string>6.0</string>
17+
<key>CFBundleName</key>
18+
<string>platform_channels_benchmarks</string>
19+
<key>CFBundlePackageType</key>
20+
<string>APPL</string>
21+
<key>CFBundleShortVersionString</key>
22+
<string>$(FLUTTER_BUILD_NAME)</string>
23+
<key>CFBundleSignature</key>
24+
<string>????</string>
25+
<key>CFBundleVersion</key>
26+
<string>$(FLUTTER_BUILD_NUMBER)</string>
27+
<key>LSRequiresIPhoneOS</key>
28+
<true/>
29+
<key>UIApplicationSupportsIndirectInputEvents</key>
30+
<true/>
31+
<key>UILaunchStoryboardName</key>
32+
<string>LaunchScreen</string>
33+
<key>UIMainStoryboardFile</key>
34+
<string>Main</string>
35+
<key>UISupportedInterfaceOrientations</key>
36+
<array>
37+
<string>UIInterfaceOrientationPortrait</string>
38+
<string>UIInterfaceOrientationLandscapeLeft</string>
39+
<string>UIInterfaceOrientationLandscapeRight</string>
40+
</array>
41+
<key>UISupportedInterfaceOrientations~ipad</key>
42+
<array>
43+
<string>UIInterfaceOrientationPortrait</string>
44+
<string>UIInterfaceOrientationPortraitUpsideDown</string>
45+
<string>UIInterfaceOrientationLandscapeLeft</string>
46+
<string>UIInterfaceOrientationLandscapeRight</string>
47+
</array>
48+
</dict>
49+
</plist>

packages/flutter_tools/lib/src/features.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,9 +263,9 @@ const uiSceneMigration = Feature(
263263
'otherwise instruct you to migrate manually.',
264264
configSetting: 'enable-uiscene-migration',
265265
environmentOverride: 'FLUTTER_UISCENE_MIGRATION',
266-
master: FeatureChannelSetting(available: true),
267-
beta: FeatureChannelSetting(available: true),
268-
stable: FeatureChannelSetting(available: true),
266+
master: FeatureChannelSetting(available: true, enabledByDefault: true),
267+
beta: FeatureChannelSetting(available: true, enabledByDefault: true),
268+
stable: FeatureChannelSetting(available: true, enabledByDefault: true),
269269
);
270270

271271
/// A [Feature] is a process for conditionally enabling tool features.

packages/flutter_tools/templates/app/ios.tmpl/Runner.xcodeproj/project.pbxproj.tmpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; };
1212
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
1313
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
14+
7884E8682EC3CC0700C636F2 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */; };
1415
{{#withSwiftPackageManager}}
1516
78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; };
1617
{{/withSwiftPackageManager}}
@@ -50,6 +51,7 @@
5051
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
5152
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
5253
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
54+
7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
5355
{{#withSwiftPackageManager}}
5456
78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = FlutterGeneratedPluginSwiftPackage; path = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; sourceTree = "<group>"; };
5557
{{/withSwiftPackageManager}}
@@ -128,6 +130,7 @@
128130
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
129131
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
130132
74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
133+
7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */,
131134
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
132135
);
133136
path = Runner;
@@ -292,6 +295,7 @@
292295
files = (
293296
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
294297
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
298+
7884E8682EC3CC0700C636F2 /* SceneDelegate.swift in Sources */,
295299
);
296300
runOnlyForDeploymentPostprocessing = 0;
297301
};

packages/flutter_tools/templates/app/ios.tmpl/Runner/AppDelegate.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@ import Flutter
22
import UIKit
33

44
@main
5-
@objc class AppDelegate: FlutterAppDelegate {
5+
@objc class AppDelegate: FlutterAppDelegate, FlutterImplicitEngineDelegate {
66
override func application(
77
_ application: UIApplication,
88
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
99
) -> Bool {
10-
GeneratedPluginRegistrant.register(with: self)
1110
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
1211
}
12+
13+
func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) {
14+
GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry)
15+
}
1316
}

packages/flutter_tools/templates/app/ios.tmpl/Runner/Info.plist.tmpl

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
5+
<key>CADisableMinimumFrameDurationOnPhone</key>
6+
<true/>
57
<key>CFBundleDevelopmentRegion</key>
68
<string>$(DEVELOPMENT_LANGUAGE)</string>
79
<key>CFBundleDisplayName</key>
@@ -24,6 +26,29 @@
2426
<string>$(FLUTTER_BUILD_NUMBER)</string>
2527
<key>LSRequiresIPhoneOS</key>
2628
<true/>
29+
<key>UIApplicationSceneManifest</key>
30+
<dict>
31+
<key>UIApplicationSupportsMultipleScenes</key>
32+
<false/>
33+
<key>UISceneConfigurations</key>
34+
<dict>
35+
<key>UIWindowSceneSessionRoleApplication</key>
36+
<array>
37+
<dict>
38+
<key>UISceneClassName</key>
39+
<string>UIWindowScene</string>
40+
<key>UISceneConfigurationName</key>
41+
<string>flutter</string>
42+
<key>UISceneDelegateClassName</key>
43+
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
44+
<key>UISceneStoryboardFile</key>
45+
<string>Main</string>
46+
</dict>
47+
</array>
48+
</dict>
49+
</dict>
50+
<key>UIApplicationSupportsIndirectInputEvents</key>
51+
<true/>
2752
<key>UILaunchStoryboardName</key>
2853
<string>LaunchScreen</string>
2954
<key>UIMainStoryboardFile</key>
@@ -41,9 +66,5 @@
4166
<string>UIInterfaceOrientationLandscapeLeft</string>
4267
<string>UIInterfaceOrientationLandscapeRight</string>
4368
</array>
44-
<key>CADisableMinimumFrameDurationOnPhone</key>
45-
<true/>
46-
<key>UIApplicationSupportsIndirectInputEvents</key>
47-
<true/>
4869
</dict>
4970
</plist>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import Flutter
2+
import UIKit
3+
4+
class SceneDelegate: FlutterSceneDelegate {
5+
6+
}

packages/flutter_tools/templates/module/ios/host_app_ephemeral/Runner.tmpl/Info.plist.tmpl

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
5+
<key>CADisableMinimumFrameDurationOnPhone</key>
6+
<true/>
57
<key>CFBundleDevelopmentRegion</key>
68
<string>$(DEVELOPMENT_LANGUAGE)</string>
79
<key>CFBundleExecutable</key>
@@ -24,6 +26,29 @@
2426
<string>$(FLUTTER_BUILD_NUMBER)</string>
2527
<key>LSRequiresIPhoneOS</key>
2628
<true/>
29+
<key>UIApplicationSceneManifest</key>
30+
<dict>
31+
<key>UIApplicationSupportsMultipleScenes</key>
32+
<false/>
33+
<key>UISceneConfigurations</key>
34+
<dict>
35+
<key>UIWindowSceneSessionRoleApplication</key>
36+
<array>
37+
<dict>
38+
<key>UISceneClassName</key>
39+
<string>UIWindowScene</string>
40+
<key>UISceneConfigurationName</key>
41+
<string>flutter</string>
42+
<key>UISceneDelegateClassName</key>
43+
<string>SceneDelegate</string>
44+
<key>UISceneStoryboardFile</key>
45+
<string>Main</string>
46+
</dict>
47+
</array>
48+
</dict>
49+
</dict>
50+
<key>UIApplicationSupportsIndirectInputEvents</key>
51+
<true/>
2752
<key>UILaunchStoryboardName</key>
2853
<string>LaunchScreen</string>
2954
<key>UIMainStoryboardFile</key>
@@ -41,9 +66,5 @@
4166
<string>UIInterfaceOrientationLandscapeLeft</string>
4267
<string>UIInterfaceOrientationLandscapeRight</string>
4368
</array>
44-
<key>CADisableMinimumFrameDurationOnPhone</key>
45-
<true/>
46-
<key>UIApplicationSupportsIndirectInputEvents</key>
47-
<true/>
4869
</dict>
4970
</plist>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#import <Flutter/Flutter.h>
2+
#import <UIKit/UIKit.h>
3+
4+
@interface SceneDelegate : FlutterSceneDelegate
5+
6+
@end
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#import "SceneDelegate.h"
2+
3+
@implementation SceneDelegate
4+
5+
@end

packages/flutter_tools/templates/module/ios/host_app_ephemeral/Runner.xcodeproj.tmpl/project.pbxproj.tmpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10+
7884E86B2EC3CF5C00C636F2 /* SceneDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7884E86A2EC3CF5C00C636F2 /* SceneDelegate.m */; };
1011
978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; };
1112
97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; };
1213
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
@@ -30,6 +31,8 @@
3031
/* Begin PBXFileReference section */
3132
74974046213559DB008C567A /* Release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = "<group>"; };
3233
74974047213559DB008C567A /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = "<group>"; };
34+
7884E8692EC3CF5C00C636F2 /* SceneDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SceneDelegate.h; sourceTree = "<group>"; };
35+
7884E86A2EC3CF5C00C636F2 /* SceneDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SceneDelegate.m; sourceTree = "<group>"; };
3336
7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
3437
7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
3538
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = ../.ios/Flutter/Generated.xcconfig; sourceTree = "<group>"; };
@@ -92,6 +95,8 @@
9295
97C146F01CF9000F007C117D /* Runner */ = {
9396
isa = PBXGroup;
9497
children = (
98+
7884E8692EC3CF5C00C636F2 /* SceneDelegate.h */,
99+
7884E86A2EC3CF5C00C636F2 /* SceneDelegate.m */,
95100
7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */,
96101
7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */,
97102
97C146FA1CF9000F007C117D /* Main.storyboard */,
@@ -220,6 +225,7 @@
220225
buildActionMask = 2147483647;
221226
files = (
222227
978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */,
228+
7884E86B2EC3CF5C00C636F2 /* SceneDelegate.m in Sources */,
223229
97C146F31CF9000F007C117D /* main.m in Sources */,
224230
);
225231
runOnlyForDeploymentPostprocessing = 0;

0 commit comments

Comments
 (0)