feat: Support UIScene Lifecyle#423
Conversation
|
To view this pull requests documentation preview, visit the following URL: docs.page/abausg/home_widget~423 Documentation is deployed and generated using docs.page. |
WalkthroughThis PR upgrades Flutter/Dart SDK constraints, migrates iOS apps to implicit engine delegates with new scene lifecycle support, integrates FlutterGeneratedPluginSwiftPackage across Xcode builds, and refactors code formatting throughout examples and tests. ChangesiOS Plugin Architecture and Build System Migration
Code Formatting and Test Updates
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (2 warnings, 1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #423 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 3 3
Lines 175 174 -1
=========================================
- Hits 175 174 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/home_widget/example/ios/Runner.xcodeproj/project.pbxproj (1)
297-307:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winRemove the leftover
[CP] Embed Pods Frameworksbuild phase from the home_widget iOS Runner.
packages/home_widget/example/ios/Runner.xcodeproj/project.pbxprojstill contains the legacy CocoaPods embed-frameworks phase (DA06ECC516BB8D6C47C7C8FB) even though the project is already wired toFlutterGeneratedPluginSwiftPackage, so it should be removed to avoid redundant embed/codesign behavior.🛠️ Proposed cleanup
97C146ED1CF9000F007C117D /* Runner */ = { packageProductDependencies = ( 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */, ); isa = PBXNativeTarget; @@ buildPhases = ( D05EB4AE28294B897266E68B /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3AAC6A4E2B1CD43900ED5F59 /* Embed Foundation Extensions */, - DA06ECC516BB8D6C47C7C8FB /* [CP] Embed Pods Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, ); @@ - DA06ECC516BB8D6C47C7C8FB /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - };🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/home_widget/example/ios/Runner.xcodeproj/project.pbxproj` around lines 297 - 307, Remove the legacy CocoaPods embed-frameworks build phase entry (identifier DA06ECC516BB8D6C47C7C8FB, name "[CP] Embed Pods Frameworks") from the Runner target's buildPhases array and delete the corresponding PBXBuildPhase/PBXCopyFilesBuildPhase object and any references to DA06ECC516BB8D6C47C7C8FB elsewhere in the project.pbxproj so the project no longer contains the redundant embed/codesign phase now handled by FlutterGeneratedPluginSwiftPackage.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/home_widget/lib/src/home_widget_info.dart`:
- Around line 42-45: The parsing of configuration mutates the caller-owned data
map by using cascade with removeWhere on (data['configuration']), so change the
code in the fromMap parsing for configuration to operate on a shallow copy
instead of mutating data: when reading data['configuration'] create a new Map
copy (e.g., Map.from or Map<String,dynamic>.from) and then call removeWhere/cast
on that copy before assigning to the configuration field; reference the
configuration parsing expression that currently uses ((data['configuration'] as
Map<dynamic, dynamic>?) ?..removeWhere(...))?.cast<String, dynamic>() and ensure
the original data variable is not modified.
In `@pubspec.yaml`:
- Line 5: Update the pubspec and PR text to make the minimum SDK rationale
accurate: if UIScene support is the justification, state that UIScene is
supported starting Flutter 3.41 and not 3.38.1, and either lower or correct the
Flutter minimum accordingly; if you intend to require Dart SDK ^3.10.0 and
Flutter 3.38.1 as a general breaking minimum (unrelated to UIScene), explicitly
state that in the PR/changelog and mark it as a breaking change. Ensure the
pubspec.yaml sdk: ^3.10.0 declaration is consistent with the documented Flutter
minimum and that the changelog/PR description documents the breaking-minimum
requirement and rationale for UIScene vs general SDK bump.
---
Outside diff comments:
In `@packages/home_widget/example/ios/Runner.xcodeproj/project.pbxproj`:
- Around line 297-307: Remove the legacy CocoaPods embed-frameworks build phase
entry (identifier DA06ECC516BB8D6C47C7C8FB, name "[CP] Embed Pods Frameworks")
from the Runner target's buildPhases array and delete the corresponding
PBXBuildPhase/PBXCopyFilesBuildPhase object and any references to
DA06ECC516BB8D6C47C7C8FB elsewhere in the project.pbxproj so the project no
longer contains the redundant embed/codesign phase now handled by
FlutterGeneratedPluginSwiftPackage.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 87b25b1e-b95e-4a49-9d37-1ffea9b91704
📒 Files selected for processing (32)
examples/configurable_widget/ios/Flutter/AppFrameworkInfo.plistexamples/configurable_widget/ios/Runner.xcodeproj/project.pbxprojexamples/configurable_widget/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcschemeexamples/configurable_widget/lib/android_configuration_page.dartexamples/configurable_widget/lib/main.dartexamples/configurable_widget/pubspec.yamlexamples/file_and_images/ios/Flutter/AppFrameworkInfo.plistexamples/file_and_images/ios/Runner.xcodeproj/project.pbxprojexamples/file_and_images/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcschemeexamples/file_and_images/ios/Runner/AppDelegate.swiftexamples/file_and_images/ios/Runner/Info.plistexamples/lockscreen_widgets/ios/Flutter/AppFrameworkInfo.plistexamples/lockscreen_widgets/ios/Runner.xcodeproj/project.pbxprojexamples/lockscreen_widgets/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcschemeexamples/lockscreen_widgets/ios/Runner/AppDelegate.swiftexamples/lockscreen_widgets/ios/Runner/Info.plistexamples/lockscreen_widgets/pubspec.yamlpackages/home_widget/example/integration_test/android_test.dartpackages/home_widget/example/integration_test/ios_test.dartpackages/home_widget/example/ios/Flutter/AppFrameworkInfo.plistpackages/home_widget/example/ios/Runner.xcodeproj/project.pbxprojpackages/home_widget/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcschemepackages/home_widget/example/lib/main.dartpackages/home_widget/example/pubspec.yamlpackages/home_widget/ios/home_widget/Sources/home_widget/HomeWidgetPlugin.swiftpackages/home_widget/lib/src/home_widget.dartpackages/home_widget/lib/src/home_widget_callback_dispatcher.dartpackages/home_widget/lib/src/home_widget_info.dartpackages/home_widget/pubspec.yamlpackages/home_widget/test/background_test.dartpackages/home_widget/test/home_widget_test.dartpubspec.yaml
💤 Files with no reviewable changes (4)
- packages/home_widget/example/ios/Flutter/AppFrameworkInfo.plist
- examples/configurable_widget/ios/Flutter/AppFrameworkInfo.plist
- examples/file_and_images/ios/Flutter/AppFrameworkInfo.plist
- examples/lockscreen_widgets/ios/Flutter/AppFrameworkInfo.plist
| configuration: | ||
| ((data['configuration'] as Map<dynamic, dynamic>?) | ||
| ?..removeWhere((key, _) => key is! String)) | ||
| ?.cast<String, dynamic>(), |
There was a problem hiding this comment.
Avoid mutating the input data map while parsing configuration.
Line 43-45 removes keys in-place via cascade, which mutates caller-owned input. Clone before filtering to keep fromMap side-effect free.
Proposed fix
- configuration:
- ((data['configuration'] as Map<dynamic, dynamic>?)
- ?..removeWhere((key, _) => key is! String))
- ?.cast<String, dynamic>(),
+ configuration:
+ (data['configuration'] as Map<dynamic, dynamic>?)
+ ?.map((key, value) => MapEntry(key, value))
+ ..removeWhere((key, _) => key is! String)
+ ?.cast<String, dynamic>(),🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/home_widget/lib/src/home_widget_info.dart` around lines 42 - 45, The
parsing of configuration mutates the caller-owned data map by using cascade with
removeWhere on (data['configuration']), so change the code in the fromMap
parsing for configuration to operate on a shallow copy instead of mutating data:
when reading data['configuration'] create a new Map copy (e.g., Map.from or
Map<String,dynamic>.from) and then call removeWhere/cast on that copy before
assigning to the configuration field; reference the configuration parsing
expression that currently uses ((data['configuration'] as Map<dynamic,
dynamic>?) ?..removeWhere(...))?.cast<String, dynamic>() and ensure the original
data variable is not modified.
|
|
||
| environment: | ||
| sdk: ^3.9.0 | ||
| sdk: ^3.10.0 |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
What is the latest stable version of Dart SDK as of May 2026?
💡 Result:
As of 2026-05-25, the latest stable Dart SDK version is 3.11.6.[1][2] This comes from the Dart SDK stable changelog showing 3.11.6 released on 2026-05-05.[1] The Dart source tag list also has a 3.11.6 tag.[2]
Citations:
- 1: https://dart.googlesource.com/sdk/+/stable/CHANGELOG.md
- 2: https://dart.googlesource.com/sdk/+/refs/tags/3.11.6
🌐 Web query:
What is the latest stable version of Flutter SDK as of May 2026?
💡 Result:
The latest stable Flutter SDK version as of May 25, 2026 is Flutter 3.44.0.[1][2] Evidence: The Flutter SDK archive documentation states that “Unless stated otherwise, the documentation on this site reflects Flutter 3.44.0” and lists Flutter 3.44 as the May 2026 stable release, with the page last updated on 2026-05-20.[1] The Flutter release notes page also lists “3.44.0” under stable releases and indicates the page reflects Flutter 3.44.0 (last updated 2026-05-15).[2]
Citations:
🌐 Web query:
What Flutter version introduced UIScene lifecycle support for iOS?
💡 Result:
Flutter version 3.41 introduced (and supports by default) UIScene lifecycle support for iOS apps. [1] Flutter’s UIScene migration documentation states: “As of Flutter 3.41, UIScene is supported by default.” [1]
Citations:
Fix the minimum SDK rationale (UIScene) and document breaking min-requirements.
- Flutter UIScene is supported by default starting with Flutter 3.41, so requiring Flutter 3.38.1 for UIScene support isn’t consistent with the documented timeline.
- Raising minimum SDK requirements (e.g.,
sdk: ^3.10.0and the corresponding Flutter minimum) is effectively a breaking change for users pinned to older SDKs—update the PR/changelog accordingly. - If Dart 3.10.0 / Flutter 3.38.1 are intended minimums, ensure the PR text clearly states that intent and the rationale (separate from UIScene).
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@pubspec.yaml` at line 5, Update the pubspec and PR text to make the minimum
SDK rationale accurate: if UIScene support is the justification, state that
UIScene is supported starting Flutter 3.41 and not 3.38.1, and either lower or
correct the Flutter minimum accordingly; if you intend to require Dart SDK
^3.10.0 and Flutter 3.38.1 as a general breaking minimum (unrelated to UIScene),
explicitly state that in the PR/changelog and mark it as a breaking change.
Ensure the pubspec.yaml sdk: ^3.10.0 declaration is consistent with the
documented Flutter minimum and that the changelog/PR description documents the
breaking-minimum requirement and rationale for UIScene vs general SDK bump.
|
When will it get merged? and published as new version? |
Description
Migrating to support UIScene Lifecycle
Checklist
exampleor documentation.Breaking Change?
Related Issues