Repository navigation
Commit be1bcf5
authored
Problem: Flutter 3.50 deprecates the Material library the app imports, so analysis fails on the new SDK (#153)
## Summary
Flutter 3.50 deprecates `package:flutter/material.dart` and
`package:flutter/cupertino.dart` in favour of the `material_ui` and
`cupertino_ui` packages. On the new SDK, `dart analyze --fatal-infos`
reports 175 infos, so CI fails until the app moves over. This PR
upgrades to Flutter 3.50.0 / Dart 3.14.0, moves the app to
`material_ui`, and takes the fixes the new releases unlock.
**The migration is more than imports.** `material_ui` is a separate copy
of Material with its own `Theme`, `Scaffold` and `MaterialLocalizations`
types, and lookups are keyed by type:
- gen-l10n in 3.50 still emits the deprecated `flutter_localizations`
delegates (flutter/flutter#191072), which `material_ui` widgets cannot
read. With the imports rewritten and nothing else, 14 `zh_TW`/`zh_CN`
tests failed with no `MaterialLocalizations`. Every `MaterialApp` now
uses `appLocalizationsDelegates` (`lib/core/l10n/`), and the generated
`lib/l10n` is excluded from analysis until gen-l10n catches up.
- `flutter_slidable` 4.0.3 was still on the framework copy, so swipe
actions could not see the app theme (a `zh_TW` label lost the app's
typography). 5.2.0 moves to `material_ui`.
- `go_router` 18 already detected `material_ui`'s `MaterialApp`, which
is why `_materialPage` existed. With the app on `material_ui`, it goes.
Dart 3.14 brings no language features or formatter changes worth
adopting here. The one new Flutter 3.50 widget with a real use is
`SliverClipRRect`.
## Commits
1. `build(deps): move to Flutter 3.50.0, Dart 3.14.0 and material_ui`:
the SDK bump, the scoped `dart fix --code=migrate_design_widgets` import
rewrite, the delegates const, and the docs (`AGENTS.md`, `PRD.md`,
`README.md`, `dependencies.md`). One commit because neither the bump nor
the rewrite analyses on its own, and the rewrite and the delegate swap
cannot test apart.
2. `build(deps): bump material_ui to 1.11.0 and cupertino_ui to 1.1.6`:
bottom-sheet listener leak, `Switch` first-paint crash, `InputDecorator`
fixes.
3. `build(deps): bump flutter_slidable to 5.2.0`: on `material_ui`;
diagonal scrolls no longer open a row. A new test fails on 4.0.3.
4. `fix(shopping-list): clip rows to the card's rounded corners`:
d52c902 lost the clip; restored with `SliverClipRRect` and `clipOverlap:
ClipOverlapBehavior.none` (the default cuts a notch into the top row
while scrolled).
5. `fix(app,deps): let system back leave the app after switching tabs
with a sub-route open`: `go_router` 18.1.4. Regression test fails on
18.1.2.
6. `fix(data): delete the iOS CSV export copy that file_picker 13.3.3
leaves behind`: `file_picker_darwin` 2.5.1 moved the temp copy to
`tmp/flutter_file_picker/<UUID>/`; without this, an unencrypted export
would stay in `tmp/`.
7. `docs: update the toolchain facts for Flutter 3.50.0`: Gradle/AGP/KGP
thresholds, the `flutter analyze --suggestions` false positive, and why
`android.newDsl=false` stays (`android_file_picker`, not Flutter, now).
8. `refactor(app): let go_router build the MaterialPage for non-modal
routes`: deletes `_materialPage` (−38 lines in `router.dart`).
9. `build(deps): bump the Riverpod stack to 3.5.0 and riverpod_lint to
3.2.0`: the six deprecated `exists` calls become
`read(provider.exists)`.
10. `ci: fail when riverpod_lint is not running`: a `riverpod_lint`
version that cannot resolve is skipped silently, and `dart analyze
--fatal-infos` still prints "No issues found!".
`tool/check_riverpod_lint.sh` adds a deliberate violation and fails
unless it is reported.
11. `build(deps): bump build_runner to 2.17.1`: the hold is lifted;
generated files are unchanged.
12. `feat(home,analysis): skip the day and period slide when Reduce
Motion is on`: Flutter 3.50's `MediaQuery.reduceMotionOf` (iOS). New PRD
Accessibility rule.
## Verification
- Every commit passed the full CI sequence on its own in a fresh clone:
`pub get --enforce-lockfile`, `build_runner` with no diff, `dart
format`, `dart analyze --fatal-infos`, the riverpod_lint check (from
commit 10), the 23 architecture tests and the full suite. The tip passes
2,353 tests.
- Each fix has a test that was watched failing without it: the `zh`
delegate tests, the slidable typography test (4.0.3), the shopping-list
corner and scrolled-row hit tests, the back-button test (`go_router`
18.1.2), the CSV temp tests (including one that catches deleting more
than the plugin's folder), and the Reduce Motion tests.
`tool/check_riverpod_lint.sh` fails with `riverpod_lint: 3.1.2` and
passes with 3.2.0.
- An independent review covered correctness, project standards, tests
and release risk, and a skeptic tried to refute each finding. It
confirmed three minor findings; two are fixed in commits 10 and 12, and
the third is the device list below.
- The release arm64 APK is 196,632 bytes (+0.75%) larger than `main`'s.
## Before merging (devices)
- [ ] `ios-nightly` passes: no `ios/Podfile`, `sqlite3.framework`
embedded. The local iOS build cannot run (Xcode lacks the iOS 26.2
platform).
- [ ] Swipe rows on all 7 Slidable lists; vertical and diagonal scrolls
no longer open a row; the 4 s undo flows still work.
- [ ] Shopping list: swiping the first and last rows stays inside the
rounded corners; the card shadow still shows; a half-scrolled top row
has no notch.
- [ ] Undo snackbar at 2× font on a screen under about 342dp wide:
"Undo" moves to its own row (Material's intended layout) and can still
be tapped.
- [ ] Android: push and pop Settings → About (WebView) and the Settings
sub-pages in light and dark; no flicker or frozen frames.
- [ ] Android back: Settings → Categories, switch to Home, press back,
and the app exits.
- [ ] iOS: export a CSV once saved and once cancelled; the app's `tmp/`
has no `flutter_file_picker` folder afterwards.
- [ ] iOS with Reduce Motion on: the Home day switch and the Analysis
period switch appear without sliding.
## Not changed
- `fl_chart` 1.3.1 is not taken: its rendering change applies only with
a `transformationConfig`, which the app never sets.
- Primary constructors (a Dart 3.13 feature) could remove about 1,000
lines but need a curated pass; that is a separate cleanup.198 files changed
Lines changed: 835 additions & 499 deletions
File tree
- .github/workflows
- android
- docs
- architecture
- solutions
- architecture-patterns
- developer-experience
- logic-errors
- lib
- app
- providers
- core
- l10n
- utils
- data
- repositories
- seed
- services
- ui
- core
- theme
- widgets
- features
- accounts/views
- analysis
- charts/views
- search
- view_models
- views
- views
- categories/views
- home/views
- recurring/views
- settings
- csv_export/views
- csv_import/views
- view_models
- views
- shopping_list/views
- splash/views
- transactions/views
- test
- integration
- unit
- app
- controllers
- providers
- repositories
- seed
- services
- utils
- widget
- app
- features
- accounts
- analysis
- widgets
- categories
- home
- recurring
- settings
- shopping_list
- splash
- transactions
- smoke
- theme
- tool
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
66 | | - | |
67 | | - | |
| 65 | + | |
| 66 | + | |
68 | 67 | | |
69 | 68 | | |
70 | 69 | | |
71 | 70 | | |
72 | | - | |
| 71 | + | |
73 | 72 | | |
74 | 73 | | |
75 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
76 | 81 | | |
77 | 82 | | |
78 | 83 | | |
| |||
84 | 89 | | |
85 | 90 | | |
86 | 91 | | |
87 | | - | |
| 92 | + | |
88 | 93 | | |
89 | 94 | | |
90 | 95 | | |
| |||
120 | 125 | | |
121 | 126 | | |
122 | 127 | | |
123 | | - | |
| 128 | + | |
124 | 129 | | |
125 | 130 | | |
126 | 131 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
| 115 | + | |
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
167 | | - | |
| 167 | + | |
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
| |||
198 | 198 | | |
199 | 199 | | |
200 | 200 | | |
201 | | - | |
| 201 | + | |
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
| |||
0 commit comments