Skip to content

fix: update Flutter deprecated list APIs#1174

Merged
lollipopkit merged 9 commits into
mainfrom
fix/flutter-344-deprecations
Jun 5, 2026
Merged

fix: update Flutter deprecated list APIs#1174
lollipopkit merged 9 commits into
mainfrom
fix/flutter-344-deprecations

Conversation

@lollipopkit

@lollipopkit lollipopkit commented May 19, 2026

Copy link
Copy Markdown
Owner

Summary

  • replace deprecated cacheExtent with scrollCacheExtent
  • migrate ReorderableListView callbacks from onReorder to onReorderItem
  • keep reorder index handling aligned with the adjusted onReorderItem semantics
  • update lockfile after local Flutter 3.44.0 dependency resolution

Verification

  • flutter analyze lib test

Notes

  • Flutter 3.44.0 reports Swift Package Manager adoption warnings for existing plugins; analyze still passes.

Summary by CodeRabbit

  • New Features

    • More predictable drag-and-drop reordering across settings and server lists.
    • Editor now carries explicit light/dark syntax theme choices when opening files.
  • Bug Fixes

    • Improved list scrolling/caching to reduce jank and improve responsiveness.
    • iCloud backup listing ignores entries without timestamps to ensure correct latest-file selection.
  • Chores

    • Upgraded Flutter SDK; refreshed iOS/macOS project and Swift package integrations.
    • Updated dependency sources and refreshed submodule references.

@coderabbitai

coderabbitai Bot commented May 19, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 7666d2a2-eaeb-4919-a563-cc1ab2752cc2

📥 Commits

Reviewing files that changed from the base of the PR and between 1d8e9b5 and 2fbcabc.

📒 Files selected for processing (1)
  • ios/Runner/AppDelegate.swift
🚧 Files skipped from review as they are similar to previous changes (1)
  • ios/Runner/AppDelegate.swift

📝 Walkthrough

Walkthrough

This PR migrates multiple ReorderableListView usages from onReorder to onReorderItem and removes the previous downward-move index compensation, updates a ListView to use ScrollCacheExtent.pixels, propagates editor light/dark theme args to EditorPage, filters iCloud backup entries with null timestamps, integrates a generated local Swift package into iOS/macOS Xcode projects, adds SwiftPM lockfiles and scheme preactions, bumps pubspec Flutter SDK to >=3.44.0 and converts two dependencies to Git refs, updates several submodule pointers, and adjusts CI workflows to reference Flutter 3.44.1 (build) and unpin analysis.

Possibly related PRs

  • lollipopkit/flutter_server_box#930: Modifies server-order drag-reordering logic in lib/view/page/setting/seq/srv_seq.dart with similar target index computation and order persistence changes.
  • lollipopkit/flutter_server_box#1026: Refactors reorder and enablement logic across multiple settings sequence pages (srv_detail_seq.dart, srv_func_seq.dart, virt_key.dart) with overlapping code paths.
  • lollipopkit/flutter_server_box#1177: Addresses Flutter CI/workflow Flutter version pins related to Flutter 3.44 compatibility; this PR updates CI and pubspec to 3.44.x.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and accurately summarizes the main objective of the changeset: updating deprecated Flutter list APIs (cacheExtent → scrollCacheExtent, onReorder → onReorderItem).
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/flutter-344-deprecations

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot]
coderabbitai Bot previously approved these changes May 19, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 6e918b0 and 272c402.

⛔ Files ignored due to path filters (2)
  • ios/Podfile.lock is excluded by !**/*.lock
  • pubspec.lock is excluded by !**/*.lock
📒 Files selected for processing (11)
  • .github/workflows/build.yml
  • ios/Runner.xcodeproj/project.pbxproj
  • ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
  • ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
  • ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved
  • lib/data/ssh/persistent_shell.dart
  • packages/circle_chart
  • packages/fl_lib
  • packages/plain_notification_token
  • packages/watch_connectivity
  • pubspec.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

Comment thread ios/Runner.xcodeproj/project.pbxproj
Comment thread lib/data/ssh/persistent_shell.dart Outdated
Comment thread pubspec.yaml Outdated
Comment on lines +33 to +36
re_editor:
git:
url: https://github.com/lollipopkit/re-editor
ref: main

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 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."
fi

Repository: 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
ios/Runner/AppDelegate.swift (1)

22-28: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Fix missing FlutterResult handling in home_widget method channel
homeWidgetChannel.setMethodCallHandler contains no result(...) call (including when handling "update"), so Dart invokeMethod can remain pending indefinitely.

Suggested fix
-        homeWidgetChannel.setMethodCallHandler({(call: FlutterMethodCall, result: `@escaping` FlutterResult) -&gt; Void in
-            if call.method == "update" {
-                if `#available`(iOS 14.0, *) {
-                    WidgetCenter.shared.reloadTimelines(ofKind: "StatusWidget")
-                }
-            }
-        })
+        homeWidgetChannel.setMethodCallHandler({ (call: FlutterMethodCall, result: `@escaping` FlutterResult) -&gt; Void in
+            switch call.method {
+            case "update":
+                if `#available`(iOS 14.0, *) {
+                    WidgetCenter.shared.reloadTimelines(ofKind: "StatusWidget")
+                }
+                result(nil)
+            default:
+                result(FlutterMethodNotImplemented)
+            }
+        })
🤖 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/AppDelegate.swift` around lines 22 - 28, The method channel
handler registered with homeWidgetChannel.setMethodCallHandler does not call the
provided FlutterResult, leaving Dart calls hanging; update the handler in
AppDelegate.swift to call result(nil) after handling the "update" case (after
WidgetCenter.shared.reloadTimelines(ofKind: "StatusWidget")) and to call
result(FlutterMethodNotImplemented) for any unrecognized call.method, and if an
error occurs call result(FlutterError(...)) so every execution path uses the
FlutterResult.
🤖 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.

Outside diff comments:
In `@ios/Runner/AppDelegate.swift`:
- Around line 22-28: The method channel handler registered with
homeWidgetChannel.setMethodCallHandler does not call the provided FlutterResult,
leaving Dart calls hanging; update the handler in AppDelegate.swift to call
result(nil) after handling the "update" case (after
WidgetCenter.shared.reloadTimelines(ofKind: "StatusWidget")) and to call
result(FlutterMethodNotImplemented) for any unrecognized call.method, and if an
error occurs call result(FlutterError(...)) so every execution path uses the
FlutterResult.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 2845a357-1774-4c3d-aef1-e5b1dd630342

📥 Commits

Reviewing files that changed from the base of the PR and between 236f72b and 1d8e9b5.

⛔ Files ignored due to path filters (3)
  • ios/Podfile.lock is excluded by !**/*.lock
  • macos/Podfile.lock is excluded by !**/*.lock
  • pubspec.lock is excluded by !**/*.lock
📒 Files selected for processing (14)
  • ios/Runner.xcodeproj/project.pbxproj
  • ios/Runner/AppDelegate.swift
  • ios/Runner/Info-Debug.plist
  • ios/Runner/Info-Profile.plist
  • ios/Runner/Info-Release.plist
  • ios/Runner/Info.plist
  • lib/view/page/backup.dart
  • lib/view/page/setting/entries/app.dart
  • lib/view/page/storage/local.dart
  • lib/view/page/storage/sftp.dart
  • macos/Flutter/GeneratedPluginRegistrant.swift
  • macos/Runner.xcodeproj/project.pbxproj
  • macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
  • packages/fl_lib
✅ Files skipped from review due to trivial changes (2)
  • packages/fl_lib
  • lib/view/page/storage/sftp.dart

@lollipopkit lollipopkit merged commit 3a992cb into main Jun 5, 2026
3 checks passed
@lollipopkit lollipopkit deleted the fix/flutter-344-deprecations branch June 5, 2026 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant