Update Quickstart for Flutter/Dart to v5#237
Open
Aaron LaBeau (biozal) wants to merge 19 commits intomainfrom
Open
Update Quickstart for Flutter/Dart to v5#237Aaron LaBeau (biozal) wants to merge 19 commits intomainfrom
Aaron LaBeau (biozal) wants to merge 19 commits intomainfrom
Conversation
…nges and README update
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the Flutter/Dart quickstart app to Ditto v5, including dependency upgrades, updated Ditto initialization/sync APIs, and more reliable integration testing (notably on iOS where native permission dialogs can block Flutter-driven UI tests).
Changes:
- Bump Flutter dependencies to Ditto v5 and update app code to the new Ditto config/auth/sync APIs.
- Improve widget/integration tests (iOS permission handling via XCTest interruption monitor; cloud-sync polling instead of fixed delays).
- Update platform/build configuration and developer tooling (iOS/macOS project settings, Windows CMake settings, FVM pinning, CI device matrix).
Reviewed changes
Copilot reviewed 15 out of 19 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| flutter_app/windows/CMakeLists.txt | Updates Windows build flags and Visual Studio install behavior. |
| flutter_app/test/widget_test.dart | Replaces default template test with model/dialog unit & widget tests. |
| flutter_app/README.md | Updates prerequisites/platform notes and iOS setup instructions. |
| flutter_app/pubspec.yaml | Upgrades Ditto + related Flutter/Dart dependencies and lints. |
| flutter_app/pubspec.lock | Regenerates lockfile for upgraded dependency set and SDK baselines. |
| flutter_app/macos/Runner/DebugProfile.entitlements | Adds macOS network client entitlement for sandboxed networking. |
| flutter_app/macos/Podfile.lock | Updates CocoaPods lock to Ditto v5 and related pod versions. |
| flutter_app/macos/Podfile | Raises macOS deployment target for plugin/toolchain compatibility. |
| flutter_app/lib/main.dart | Migrates Ditto init/config/sync usage to v5 and improves initial subscription timing. |
| flutter_app/lib/dialog.dart | Adds proper controller disposal to prevent leaks in dialog widget. |
| flutter_app/ios/RunnerTests/RunnerTests.m | Replaces macro runner to auto-accept iOS permission dialogs during tests. |
| flutter_app/ios/Runner/Info.plist | Adds background BLE modes required for Ditto BLE sync behavior. |
| flutter_app/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme | Updates scheme config (debug launch, LLDB init file). |
| flutter_app/ios/Runner.xcodeproj/project.pbxproj | Sets iOS deployment target to 15.6 in multiple build configs. |
| flutter_app/ios/Podfile.lock | Updates iOS CocoaPods lock to Ditto v5 and related pod versions. |
| flutter_app/integration_test/app_test.dart | Makes integration test more resilient (longer settle, sync polling, iOS note). |
| .gitignore | Ignores FVM cache directory. |
| .github/browserstack-devices.yml | Updates BrowserStack iOS device targets to match new minimum iOS baseline. |
| .fvmrc | Pins Flutter toolchain version via FVM for reproducible builds. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrates the Flutter
flutter_quickstartapp fromditto_live4.13.1 to 5.0.0,along with the API surface, platform configuration, dependency, and test
changes that the v5 upgrade requires. Also pins the toolchain via
fvmandmodernises the surrounding lint/dependency stack.
Highlights
DittoConfig/Ditto.open(config)API replaces the deprecatedOnlinePlaygroundIdentityflow.ditto.sync.*namespace replaces top-levelstartSync/stopSync/isSyncActive.UPDATEstatements now use parameterised arguments instead ofstring interpolation — eliminates a DQL-injection vector via task titles.
raised deployment target of iOS 15.6.
tests covering the
Taskmodel andAddTaskDialog.auto-dismissed at the XCTest layer via
addUIInterruptionMonitor, and thecloud-sync wait was converted from a fixed 5 s sleep to a 45 s poll.
Dependency changes (
pubspec.yaml)ditto_live4.13.15.0.0permission_handler^11.3.1^12.0.1flutter_dotenv^5.1.0^6.0.06.0.1flutter_lints^4.0.0^6.0.0lints5.1.1 → 6.1.0Toolchain & repo
.fvmrcpinning Flutter to3.32.8so CI and contributors runthe same toolchain.
.gitignore: ignore.fvm/cache.Source changes (
lib/)lib/main.dart— v5 API migrationOnlinePlaygroundIdentity(...)+Ditto.open(identity: ...)→DittoConfig(databaseID, connect: DittoConfigConnectServer(url:))+Ditto.open(config).ditto.auth.setExpirationHandler+ditto.auth.login(token, provider: developmentProvider).ditto.startSync()/stopSync()/isSyncActive→ditto.sync.start()/sync.stop()/sync.isActive.ditto.sync.registerSubscription("SELECT * FROM tasks WHERE deleted = false")is now registered before
sync.start()so the subscription isincluded in the very first sync exchange (eliminates a 5–10 s first-sync
delay).
updateTransportConfig(...)(replaced byDittoConfig).ALTER SYSTEM SET DQL_STRICT_MODE = falseworkaround.DittoLogger.isEnabled = true/minimumLogLevel = LogLevel.debug.DITTO_AUTH_URLis now required — throws on missing env, matching theother env vars.
lib/main.dart— DQL injection hardeningAll three
UPDATEcalls converted from string-interpolated DQL to boundarguments:
| Operation | Before | After
|
|-----------------|-------------------------------------------------------------|-------------------------------------------------------------------------------------------------
-|
| Soft-delete |
UPDATE tasks SET deleted = true WHERE _id = '${task.id}'|UPDATE tasks SET deleted = true WHERE _id = :id,arguments: {"id": task.id}|
| Toggle done |
UPDATE tasks SET done = $value WHERE _id = '${task.id}'|UPDATE tasks SET done = :done WHERE _id = :id,arguments: {"done": value, "id": task.id}|
| Edit title |
UPDATE tasks SET title = '${newTask.title}' where _id ...|UPDATE tasks SET title = :title WHERE _id = :id,arguments: {"title": ..., "id": ...}|
lib/dialog.dartdispose()to release theTextEditingController(was being leakedper dialog open).
iOS
ios/Runner/Info.plistUIBackgroundModeswithbluetooth-centralandbluetooth-peripheral— required by Ditto v5 for BLE sync to operatein the background.
_http-alt._tcp.Bonjour service entry.ios/Runner.xcodeproj/project.pbxprojIPHONEOS_DEPLOYMENT_TARGET = 15.6across all three build configs(Debug / Release / Profile) to match the v5 SDK floor.
ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcschemecustomLLDBInitFile = $(SRCROOT)/Flutter/ephemeral/flutter_lldbinitfor both Test and Launch actions (modern Flutter LLDB integration).
ReleasetoDebug.ios/RunnerTests/RunnerTests.m— see Tests below.macOS
macos/Podfile:platform :osx, '10.14'→'12.0'(v5 minimum).macos/Runner/DebugProfile.entitlements: addedcom.apple.security.network.client = trueso debug builds can establishoutbound sync connections under App Sandbox.
Windows
windows/CMakeLists.txt:/W4/W5_HAS_EXCEPTIONS01CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD12(C++ exceptions are now allowed because v5's Windows binding requires them;
warning bump is opportunistic.)
Tests
test/widget_test.dart— rewrittenOld file was the unmodified Flutter "counter" smoke test (which couldn't run
because it tried to construct
DittoExampleagainst real env vars). Replacedwith 8 hermetic tests covering pieces that don't need a live Ditto
instance:
Task model:fromJson,toJson, null-id omission, roundtrip.Add task dialog: title shown for new vs. edit, cancel returnsnull,submit returns a
Task.integration_test/app_test.dartpumpAndSettlewindow for first-sync widened from 5 s → 10 s.Future.delayed(5s)plus singleexpectfor the test documentwas replaced with a 500 ms poll up to a 45 s deadline, which fixes
flakiness on slow BrowserStack devices and busy playground tenants.
ios/RunnerTests/RunnerTests.m— replaced macro with explicit suiteThe one-line
INTEGRATION_TEST_IOS_RUNNER(RunnerTests)macro was replacedwith a hand-written
XCTestCasethat adds aUIInterruptionMonitorin-setUp. The monitor automatically tapsOK/Allow/Allow While Using Appon any springboard alert that appears during therun, so Bluetooth and Local Network permission dialogs no longer block
sync from initialising in CI.
CI
.github/browserstack-devices.yml: iPhone 13 entry bumped from iOS 15 → 16to match the new
IPHONEOS_DEPLOYMENT_TARGET = 15.6.README
Test plan
fvm flutter pub getresolves cleanly on a fresh checkout.fvm flutter analyze— no issues.fvm flutter test— all 8 widget tests pass.fvm flutter runon an iOS device: app launches, accepts BT + LocalNetwork permission, syncs a task created on a second device.
fvm flutter run -d macos: app launches sandboxed, sync works.fvm flutter run -d windows: builds and runs against VS 2022.end-to-end (permission monitor dismisses dialogs, polling finds
TASK_TO_FINDwithin 45 s).',;, etc. no longer breakUPDATE(parameterised args).Risk / call-outs
This matches Ditto v5's own floor, but flag it for any user still on
those OS versions.
reason.
DITTO_AUTH_URLis now required at startup; deployments that previouslyrelied on a default will need to set it explicitly.