fix: update Flutter deprecated list APIs#1174
Conversation
📝 WalkthroughWalkthroughThis PR migrates ReorderableListView across five settings/sequence pages from the deprecated Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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 `@ios/Runner.xcodeproj/project.pbxproj`:
- Around line 1238-1241: The XCSwiftPackageProductDependency entry for
FlutterGeneratedPluginSwiftPackage is missing the required package reference;
update the XCSwiftPackageProductDependency object (the one named
FlutterGeneratedPluginSwiftPackage) to include a package = <identifier> /*
XCLocalSwiftPackageReference */; field that points to the corresponding
XCLocalSwiftPackageReference entry so the product is explicitly linked to its
package.
In `@lib/data/ssh/persistent_shell.dart`:
- Line 166: The code is using the wrong named parameter `_allowMalformed` on
Utf8Decoder which causes a compile error; update the Utf8Decoder invocations
used in the stream transforms (the .transform(const Utf8Decoder(...)) calls in
persistent_shell.dart, e.g., inside the PersistentShell read/stream handling
methods) to use the correct named parameter allowMalformed: true instead of
_allowMalformed: true, and ensure both occurrences (the one at line ~166 and the
one at line ~175) are corrected.
In `@pubspec.yaml`:
- Around line 33-36: The pubspec currently references moving branch refs for the
git dependencies re_editor and icons_plus (ref: main); update both dependency
entries in pubspec.yaml to pin them to immutable refs by replacing ref: main
with a specific tag name or commit SHA (e.g., ref: vX.Y.Z or ref: <commit-sha>)
so builds are deterministic and won’t pull unreviewed upstream changes; locate
the re_editor and icons_plus git blocks and set their ref values to the chosen
tag or commit SHA.
🪄 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: 8798657f-9a4d-4fed-a2b8-b76f4374f039
⛔ Files ignored due to path filters (2)
ios/Podfile.lockis excluded by!**/*.lockpubspec.lockis excluded by!**/*.lock
📒 Files selected for processing (11)
.github/workflows/build.ymlios/Runner.xcodeproj/project.pbxprojios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolvedios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcschemeios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolvedlib/data/ssh/persistent_shell.dartpackages/circle_chartpackages/fl_libpackages/plain_notification_tokenpackages/watch_connectivitypubspec.yaml
✅ Files skipped from review due to trivial changes (4)
- packages/watch_connectivity
- .github/workflows/build.yml
- ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
- ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved
| 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = { | ||
| isa = XCSwiftPackageProductDependency; | ||
| productName = FlutterGeneratedPluginSwiftPackage; | ||
| }; |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify whether any XCSwiftPackageProductDependency entries are missing a `package =` linkage.
# Expected: each product dependency block should include a `package =` line.
python3 - <<'PY'
import re, pathlib
p = pathlib.Path("ios/Runner.xcodeproj/project.pbxproj")
txt = p.read_text()
blocks = re.findall(r'/\* Begin XCSwiftPackageProductDependency section \*/(.*?)/\* End XCSwiftPackageProductDependency section \*/', txt, re.S)
if not blocks:
print("No XCSwiftPackageProductDependency section found")
raise SystemExit(0)
section = blocks[0]
entries = re.findall(r'(\w+ /\* .*? \*/ = \{\n.*?\n\t\t\};)', section, re.S)
for e in entries:
header = e.splitlines()[0].strip()
has_package = "package =" in e
print(f"{header} -> package_link={'yes' if has_package else 'no'}")
PYRepository: lollipopkit/flutter_server_box
Length of output: 163
🏁 Script executed:
#!/bin/bash
# Check if the XCLocalSwiftPackageReference with ID 781AD8BC2B33823900A9FFBB exists
rg "781AD8BC2B33823900A9FFBB" ios/Runner.xcodeproj/project.pbxproj -A 2 -B 2Repository: lollipopkit/flutter_server_box
Length of output: 647
🏁 Script executed:
#!/bin/bash
# List all XCLocalSwiftPackageReference entries in the file
rg "XCLocalSwiftPackageReference" ios/Runner.xcodeproj/project.pbxproj -B 1 -A 5Repository: lollipopkit/flutter_server_box
Length of output: 951
🌐 Web query:
Xcode XCSwiftPackageProductDependency package attribute required field pbxproj schema
💡 Result:
In an Xcode project.pbxproj, the object type XCSwiftPackageProductDependency represents a Swift Package Manager product dependency and includes these fields: 1) package (required) - This points to either an XCRemoteSwiftPackageReference or an XCLocalSwiftPackageReference object. It is defined as a one-to-one attribute “package” with allowed classes [1]. 2) productName (required) - This is the product’s name. It is defined as an attribute:product_name, String in xcodeproj’s model (which maps to the pbxproj field productName) [2][1]. What’s in the pbxproj “schema” for XCSwiftPackageProductDependency (example from generated pbxproj) - An XCSwiftPackageProductDependency section will look like this: isa = XCSwiftPackageProductDependency; package = /*... */; productName = ; This exact field pattern (isa/package/productName) is shown in a real pbxproj snippet produced by Xcode [3]. Notes on “required” - Based on the xcodeproj object model, both package and product_name/productName are declared as attributes for the XCSwiftPackageProductDependency object (with package defined as a required association “has_one:package...” and product_name defined as an attribute String) [2][1]. - If you omit/leave these out (or have mismatches), tooling that parses/rewrites pbxproj may fail or consider the dependency inconsistent (seen in issues around XCSwiftPackageProductDependency objects) [3][4].
Citations:
- 1: https://www.rubydoc.info/gems/xcodeproj/Xcodeproj/Project/Object/XCSwiftPackageProductDependency
- 2: https://github.com/CocoaPods/Xcodeproj/blob/master/lib/xcodeproj/project/object/swift_package_product_dependency.rb
- 3:
XCSwiftPackageProductDependencyattempted to initialize an object with unknown ISAXCLocalSwiftPackageReferencefrom attributes:{"isa"=>"XCLocalSwiftPackageReference", "relativePath"=>"MyLocalSwiftPackage"}CocoaPods/Xcodeproj#912 - 4: Error in Xcode 11b4 Projects with SPM Packages mac-cain13/R.swift#536
Add explicit package linkage for the Swift package product dependency.
Line 1238 defines XCSwiftPackageProductDependency without a package reference. According to Xcode's pbxproj schema, the package field is required for this object type. This omission can cause build failures or tooling inconsistencies when parsing the project file. The product dependency must be explicitly bound to the XCLocalSwiftPackageReference.
Suggested fix
78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = {
isa = XCSwiftPackageProductDependency;
+ package = 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */;
productName = FlutterGeneratedPluginSwiftPackage;
};🤖 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 `@ios/Runner.xcodeproj/project.pbxproj` around lines 1238 - 1241, The
XCSwiftPackageProductDependency entry for FlutterGeneratedPluginSwiftPackage is
missing the required package reference; update the
XCSwiftPackageProductDependency object (the one named
FlutterGeneratedPluginSwiftPackage) to include a package = <identifier> /*
XCLocalSwiftPackageReference */; field that points to the corresponding
XCLocalSwiftPackageReference entry so the product is explicitly linked to its
package.
| re_editor: | ||
| git: | ||
| url: https://github.com/lollipopkit/re-editor | ||
| ref: main |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify git dependency pinning and lockfile resolved refs (read-only).
set -euo pipefail
echo "== pubspec.yaml git refs =="
rg -n -A3 -B1 '^\s{2}(re_editor|icons_plus):|^\s{4}git:|^\s{6}url:|^\s{6}ref:' pubspec.yaml
LOCKFILE="$(fd -a '^pubspec\.lock$' | head -n1 || true)"
if [[ -n "${LOCKFILE}" ]]; then
echo
echo "== pubspec.lock resolved refs for re_editor/icons_plus =="
rg -n -A8 -B2 're_editor:|icons_plus:|resolved-ref:|ref:' "${LOCKFILE}"
else
echo
echo "pubspec.lock not found; cannot verify resolved-ref pinning."
fiRepository: lollipopkit/flutter_server_box
Length of output: 2228
Pin git dependencies to immutable commits/tags instead of main.
Using moving branch refs makes builds non-deterministic and can pull unreviewed upstream changes after merge. Both re_editor (line 36) and icons_plus (line 52) should be pinned to immutable tags or commit SHAs.
🔧 Suggested change
re_editor:
git:
url: https://github.com/lollipopkit/re-editor
- ref: main
+ ref: <tag-or-commit-sha>
@@
icons_plus:
git:
url: https://github.com/lollipopkit/icons_plus
- ref: main
+ ref: <tag-or-commit-sha>🤖 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` around lines 33 - 36, The pubspec currently references moving
branch refs for the git dependencies re_editor and icons_plus (ref: main);
update both dependency entries in pubspec.yaml to pin them to immutable refs by
replacing ref: main with a specific tag name or commit SHA (e.g., ref: vX.Y.Z or
ref: <commit-sha>) so builds are deterministic and won’t pull unreviewed
upstream changes; locate the re_editor and icons_plus git blocks and set their
ref values to the chosen tag or commit SHA.
Summary
Verification
Notes
Summary by CodeRabbit
Performance
Bug Fixes
Chores