Skip to content

fix(theme): import CupertinoPageTransitionsBuilder explicitly (unbreaks analyze on Flutter 3.44.x) - #246

Open
dev-noaman wants to merge 1 commit into
OpenStrap:mainfrom
dev-noaman:fix/cupertino-import
Open

fix(theme): import CupertinoPageTransitionsBuilder explicitly (unbreaks analyze on Flutter 3.44.x)#246
dev-noaman wants to merge 1 commit into
OpenStrap:mainfrom
dev-noaman:fix/cupertino-import

Conversation

@dev-noaman

Copy link
Copy Markdown

Not a CI break — a "current stable" break

CI is pinned to Flutter 3.41.6, where material.dart re-exports
CupertinoPageTransitionsBuilder. On the pin this file is fine and main is green.

On 3.44.x that re-export is gone, and flutter analyze reports 5 errors in a
file the contributor never touched:

error - The function 'CupertinoPageTransitionsBuilder' isn't defined - lib/theme/theme.dart:214:29
error - The function 'CupertinoPageTransitionsBuilder' isn't defined - lib/theme/theme.dart:215:31
error - Invalid constant value                                        - lib/theme/theme.dart:214:29
error - The values in a const map literal must be constant            - lib/theme/theme.dart:214:29
error - The values in a const map literal must be constant            - lib/theme/theme.dart:215:31

One missing symbol, then four knock-on errors as the surrounding const PageTransitionsTheme map loses its constant value.

The fix is the one this file already wrote down

theme.dart predicted this precisely and left the remedy in a comment:

// ...so if you bump the pin and this suddenly fails to resolve, re-add:
//   import 'package:flutter/cupertino.dart' show CupertinoPageTransitionsBuilder;

This PR takes that import instead of leaving it as an instruction, so the file no
longer depends on which library happens to re-export the symbol in a given release.
The comment above it is updated to explain why the import is now unconditional.

Why this is safe on the pinned toolchain too

  • material.dart re-exports the same declaration. Dart reports an ambiguity only
    when two different declarations share a name, so on 3.41.6 the analyzer simply
    sees one element reachable by two routes — not a conflict.
  • The show clause is load-bearing. An unscoped import 'package:flutter/cupertino.dart';
    would collide with material, which declares its own Card, Switch, Divider and
    others. Only the one symbol is pulled in.

Verification

On Flutter 3.44.6:

  • flutter analyze lib/5 errors → clean
  • flutter test test/boot_splash_test.dart (builds the theme) — 4 passed

I could not test on 3.41.6 locally; CI covers that, and the reasoning above is why it
should be a no-op there. If CI disagrees I'd rather find out on this one-line change
than inside a feature PR.

Out of scope

This does not fix the separate phosphor_flutter 2.1.0 breakage on newer Flutter —
class PhosphorIconData extends IconData fails now that IconData is final, which
blocks widget tests independently of this file. That needs a dependency bump and is a
different change; flagging it since it is the other thing a contributor on current
stable will hit immediately.

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) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RrVjCqVDMANK5sa5eyjATw
@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@dev-noaman, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 49 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 857273e3-98d5-4e29-9d71-3a28607697a1

📥 Commits

Reviewing files that changed from the base of the PR and between 7c789d7 and 906618e.

📒 Files selected for processing (1)
  • lib/theme/theme.dart

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

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.

2 participants