Skip to content

[go_router] migrates to material_ui and cupertino_ui - #12504

Merged
auto-submit[bot] merged 4 commits into
flutter:mainfrom
chunhtai:issues/191133
Aug 19, 2026
Merged

auto-submit[bot] merged 4 commits into
flutter:mainfrom
chunhtai:issues/191133

Conversation

@chunhtai

@chunhtai chunhtai commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

fixes flutter/flutter#191133
fixes flutter/flutter#191132

Pre-Review Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩ ↩2

@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Aug 18, 2026

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request updates the minimum supported SDK version to Flutter 3.44/Dart 3.12, simplifies several constructor initializations using initializing formals, and replaces imports of the official Flutter SDK Material library with a third-party material_ui package across the codebase, examples, and tests. Feedback indicates that migrating to the third-party material_ui package is incorrect for a core Flutter package and its examples, and these changes should be reverted to use the official Material library.

Comment on lines 18 to 20
logging: ^1.0.0
material_ui: ^1.0.0
meta: ^1.7.0

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.

critical

Adding material_ui as a dependency is incorrect. go_router is a core Flutter package and must rely on the official Material library (package:flutter/material.dart) provided by the Flutter SDK rather than an external third-party package.

  logging: ^1.0.0\n  meta: ^1.7.0

// ignore_for_file: diagnostic_describe_all_properties

import 'package:flutter/material.dart';
import 'package:material_ui/material_ui.dart';

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.

critical

Replacing package:flutter/material.dart with package:material_ui/material_ui.dart is incorrect. Please revert this import to use the official Flutter SDK Material library.

Suggested change
import 'package:material_ui/material_ui.dart';
import 'package:flutter/material.dart';

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.

lol. Get with the times. :)

Comment on lines 18 to 20
logging: ^1.0.0
material_ui: ^1.0.0
shared_preferences: ^2.0.11

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.

critical

Adding material_ui as a dependency in the example is incorrect. The example should use the official Flutter SDK Material library.

  logging: ^1.0.0\n  shared_preferences: ^2.0.11

- [State restoration](https://pub.dev/documentation/go_router/latest/topics/State%20restoration-topic.html)

## Migration Guides
- [Migrating to 18.0.0](https://flutter.dev/go/go-router-v18-breaking-changes).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@github-actions github-actions Bot added p: go_router triage-framework Should be looked at in framework triage labels Aug 18, 2026
@@ -4,8 +4,8 @@

import 'package:collection/collection.dart';
import 'package:flutter/cupertino.dart';

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.

This PR doesn't complete the job. There are two parts to the split - one is material_ui, and the other is cupertino_ui, and these need to be migrated as well.

@jonmountjoy

Copy link
Copy Markdown
Contributor

@chunhtai unfortunately I suspect that this migration (great start) is incomplete. It misses completely all the cupertino => cupertino_ui (mirroring the Material), which will play a role in things like the following working correctly:

bool isCupertinoApp(BuildContext context) =>

@Piinks

Piinks commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Yes, this should adopt cupertino_ui as well.

@chunhtai

Copy link
Copy Markdown
Contributor Author

oh i totally missed that. thanks for reminding

@chunhtai chunhtai changed the title [go_router] migrates to material_ui [go_router] migrates to material_ui and cupertino_ui Aug 19, 2026
@chunhtai
chunhtai requested a review from jonmountjoy August 19, 2026 17:01
@chunhtai

Copy link
Copy Markdown
Contributor Author

ready for another look

sdk: ^3.10.0
flutter: ">=3.38.0"
sdk: ^3.12.0
flutter: ">=3.44.0"

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.

I wonder about this, @chunhtai . Should it be 3.44.0?
I mean the material_ui/cupertino_ui split only came in 3.47.0

Maybe it's backward compatible? I have no idea.

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.

I see the cupertino_ui says it's compatible from 3.44.0 - so perhaps this is good to go...
https://github.com/flutter/packages/blob/main/packages/cupertino_ui/pubspec.yaml

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I was following this comment in this pr #12467 (comment)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

oh this is to match the lower bound for material_ui

flutter: ">=3.44.0"

@Piinks Piinks 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.

LGTM

@chunhtai chunhtai added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 19, 2026
@auto-submit
auto-submit Bot merged commit ed5bd29 into flutter:main Aug 19, 2026
13 checks passed
@justinmc

Copy link
Copy Markdown
Contributor

@chunhtai did you run the dart fix to do this? Did it work?

@chunhtai

Copy link
Copy Markdown
Contributor Author

@chunhtai did you run the dart fix to do this? Did it work?

ah I forgot we can do that, I manually fix it with help of gemini

pull Bot pushed a commit to Superoldman96/flutter that referenced this pull request Aug 20, 2026
…r#191420)

flutter/packages@fdd7d39...1785501

2026-08-20 [email protected] [material_ui]
Cleans up shader files and exposes ink_splash shader
(flutter/packages#12421)
2026-08-19 [email protected] [material_ui] Fixes
typo in code and tests (flutter/packages#12503)
2026-08-19 [email protected] [pigeon]
Fixes lint error from unused codec (flutter/packages#12512)
2026-08-19 [email protected]
[camera_android_camerax] Add explicit concurrent-futures dependency
(flutter/packages#12373)
2026-08-19 [email protected] [go_router]
migrates to material_ui and cupertino_ui (flutter/packages#12504)
2026-08-19 [email protected] [animations] Migrate to material_ui
(flutter/packages#12467)
2026-08-19 [email protected] [material_ui] Add
Material tokens (version 38.2.50) (flutter/packages#12471)
2026-08-19 [email protected] Add
`triage-design` label (flutter/packages#12488)
2026-08-19 [email protected]
[google_maps_flutter_platform_interface] Fix PinConfig code sample
(flutter/packages#12259)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC [email protected] on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
@justinmc

Copy link
Copy Markdown
Contributor

No worries, I'm we have multiple migration paths that seem to work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App CICD Run CI/CD p: go_router triage-framework Should be looked at in framework triage

Projects

None yet

4 participants