From 906618ee52d0afa25fecfe219791da41d140e691 Mon Sep 17 00:00:00 2001 From: Claude Code Date: Fri, 14 Aug 2026 18:03:37 +0300 Subject: [PATCH 1/2] fix(theme): import CupertinoPageTransitionsBuilder explicitly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CI is pinned to Flutter 3.41.6, where material.dart re-exports CupertinoPageTransitionsBuilder, so this is green on the pin and is not a broken build. On 3.44.x that re-export is gone and `flutter analyze` fails with "The function 'CupertinoPageTransitionsBuilder' isn't defined", plus 4 knock-on errors as the surrounding `const` PageTransitionsTheme map loses its constant value. Anyone developing on current stable hits 5 errors in a file they did not touch. theme.dart already predicted exactly this and wrote down the remedy: // ...so if you bump the pin and this suddenly fails to resolve, re-add: // import 'package:flutter/cupertino.dart' show CupertinoPageTransitionsBuilder; This is that import, taken rather than left as a comment, so the file no longer depends on which library happens to re-export the symbol this month. Safe on both toolchains: material.dart re-exports the SAME declaration, and Dart reports an ambiguity only when two DIFFERENT declarations share a name, so the pin sees one element reachable by two routes. The `show` clause is load-bearing — an unscoped cupertino import would genuinely collide with material, which declares its own Card, Switch and Divider. Verified on 3.44.6: `flutter analyze lib/` goes from 5 errors to clean, and test/boot_splash_test.dart (which builds the theme) passes. Not verifiable locally on 3.41.6 — CI covers that, and the reasoning above is why it should be a no-op there. Scope: this does NOT address the separate phosphor_flutter 2.1.0 breakage on newer Flutter (PhosphorIconData extends IconData, now a final class), which blocks widget tests independently of this file. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01RrVjCqVDMANK5sa5eyjATw --- lib/theme/theme.dart | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/lib/theme/theme.dart b/lib/theme/theme.dart index 55dad2e..10ac0a3 100644 --- a/lib/theme/theme.dart +++ b/lib/theme/theme.dart @@ -26,12 +26,20 @@ // [Palette] (not the live getters) so the light + dark ThemeData objects are // each internally consistent regardless of which mode is currently active. -// CupertinoPageTransitionsBuilder (used below for iOS/macOS) comes from -// material.dart on the pinned toolchain (Flutter 3.41.6 — see -// .github/workflows/test.yml). It moved between cupertino.dart and -// material.dart across Flutter versions, so if you bump the pin and this -// suddenly fails to resolve, re-add: -// import 'package:flutter/cupertino.dart' show CupertinoPageTransitionsBuilder; +// CupertinoPageTransitionsBuilder (used below for iOS/macOS) moved between +// cupertino.dart and material.dart across Flutter versions. material.dart +// re-exports it on the pinned toolchain (3.41.6 — see .github/workflows/ +// test.yml), but NOT on 3.44.x, where relying on that transitively fails with +// "The function 'CupertinoPageTransitionsBuilder' isn't defined" and takes the +// surrounding `const` map down with it (4 further errors). This file already +// predicted that and said to re-add the import; this is that import. +// +// Safe on BOTH toolchains: material.dart re-exports the SAME declaration, and +// Dart only reports an ambiguity when two DIFFERENT declarations share a name, +// so the pin simply sees one element reachable by two routes. The `show` clause +// is load-bearing — an unscoped cupertino import WOULD collide with material, +// which declares its own Card, Switch, Divider and friends. +import 'package:flutter/cupertino.dart' show CupertinoPageTransitionsBuilder; import 'package:flutter/material.dart'; import 'page_transitions.dart'; import 'tokens.dart'; From e856bb54085e4178fa9f7651c5ed41cae8b63947 Mon Sep 17 00:00:00 2001 From: Mohammad Abdul Sahil <127765312+abdulsaheel@users.noreply.github.com> Date: Sat, 15 Aug 2026 18:26:16 +0530 Subject: [PATCH 2/2] take the iOS transitions from the SDK defaults instead of naming the class MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit the import this PR added goes red on the pinned toolchain: warning • The library 'package:flutter/cupertino.dart' doesn't export a member with the shown name 'CupertinoPageTransitionsBuilder' warning • Unused import: 'package:flutter/cupertino.dart' the class MOVED rather than being re-exported by both. on 3.41.6 material.dart has it and cupertino.dart does not; on 3.44.x it is the other way round. so no unconditional import compiles on both, and picking either one just swaps which toolchain breaks. spreading PageTransitionsTheme's own default builders avoids naming it at all — the SDK already maps iOS/macOS to whatever Cupertino builder that version ships, so we override only android/fuchsia/linux/windows and inherit the rest. works on both directions, and keeps the interactive edge-swipe-back that the explicit iOS entry existed to preserve. the map is no longer const (spreading a getter), which costs nothing here — it is built once per theme. note for whoever bumps the flutter pin: 3.44.x also breaks phosphor_flutter 2.1.0, which extends IconData and stops compiling now that IconData is final. 2.1.0 is the latest release, so that one has no upstream fix yet and is the real blocker on moving the pin. --- lib/theme/theme.dart | 44 ++++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/lib/theme/theme.dart b/lib/theme/theme.dart index 10ac0a3..e593618 100644 --- a/lib/theme/theme.dart +++ b/lib/theme/theme.dart @@ -26,20 +26,24 @@ // [Palette] (not the live getters) so the light + dark ThemeData objects are // each internally consistent regardless of which mode is currently active. -// CupertinoPageTransitionsBuilder (used below for iOS/macOS) moved between -// cupertino.dart and material.dart across Flutter versions. material.dart -// re-exports it on the pinned toolchain (3.41.6 — see .github/workflows/ -// test.yml), but NOT on 3.44.x, where relying on that transitively fails with -// "The function 'CupertinoPageTransitionsBuilder' isn't defined" and takes the -// surrounding `const` map down with it (4 further errors). This file already -// predicted that and said to re-add the import; this is that import. +// iOS/macOS page transitions are NOT named here on purpose. // -// Safe on BOTH toolchains: material.dart re-exports the SAME declaration, and -// Dart only reports an ambiguity when two DIFFERENT declarations share a name, -// so the pin simply sees one element reachable by two routes. The `show` clause -// is load-bearing — an unscoped cupertino import WOULD collide with material, -// which declares its own Card, Switch, Divider and friends. -import 'package:flutter/cupertino.dart' show CupertinoPageTransitionsBuilder; +// CupertinoPageTransitionsBuilder has MOVED between SDK versions: on 3.41.6 +// (the pinned toolchain, see .github/workflows/test.yml) material.dart exports +// it and cupertino.dart does not; on 3.44.x it is the other way round. So there +// is no single import that compiles on both — importing from cupertino breaks +// the pin with "doesn't export a member with the shown name", and importing +// from material breaks newer SDKs with "isn't defined", which also takes the +// surrounding const map down with it. +// +// Spreading PageTransitionsTheme's own defaults sidesteps the question: the SDK +// already maps iOS/macOS to whatever Cupertino builder that version ships, so +// we override only the platforms we actually want changed and never name the +// moving class. Version-proof in both directions. +// +// Do not "simplify" this back to an explicit iOS entry. The Cupertino builder +// is what supplies the interactive edge-swipe-back gesture — see +// page_transitions.dart's navigation contract. import 'package:flutter/material.dart'; import 'page_transitions.dart'; import 'tokens.dart'; @@ -213,14 +217,14 @@ ThemeData buildOpenStrapTheme(Palette p) { // routes stay MaterialPageRoutes: iOS keeps the native slide transition // AND the interactive edge-swipe-back gesture; Android-likes get the // app's shared-axis fade-through. See page_transitions.dart. - pageTransitionsTheme: const PageTransitionsTheme( + pageTransitionsTheme: PageTransitionsTheme( builders: { - TargetPlatform.android: SharedAxisPageTransitionsBuilder(), - TargetPlatform.fuchsia: SharedAxisPageTransitionsBuilder(), - TargetPlatform.linux: SharedAxisPageTransitionsBuilder(), - TargetPlatform.windows: SharedAxisPageTransitionsBuilder(), - TargetPlatform.iOS: CupertinoPageTransitionsBuilder(), - TargetPlatform.macOS: CupertinoPageTransitionsBuilder(), + // iOS/macOS come from the SDK defaults — see the note at the top. + ...const PageTransitionsTheme().builders, + TargetPlatform.android: const SharedAxisPageTransitionsBuilder(), + TargetPlatform.fuchsia: const SharedAxisPageTransitionsBuilder(), + TargetPlatform.linux: const SharedAxisPageTransitionsBuilder(), + TargetPlatform.windows: const SharedAxisPageTransitionsBuilder(), }, ), );