Skip to content

chore: Migrate decoupling - #4066

Merged
spydon merged 6 commits into
flame-engine:mainfrom
justinmc:migrate-decoupling
Sep 29, 2026
Merged

spydon merged 6 commits into
flame-engine:mainfrom
justinmc:migrate-decoupling

Conversation

@justinmc

@justinmc justinmc commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Description

It was discovered in flutter/flutter#192957 that flame is blocking the framework from deprecating Material because of its customer tests. If we're not able to resolve the failure in the next few days we'll have to disable the customer tests temporarily until it's fixed. This PR should solve the problem, though.

Checklist

  • I have followed the Contributor Guide when preparing my PR.
  • I have updated/added tests for ALL new/updated/fixed functionality.
  • I have updated/added relevant documentation in docs and added dartdoc comments with ///.
  • I have updated/added relevant examples in examples or docs.

Breaking Change?

  • Yes, this PR is a breaking change.
  • No, this PR is not a breaking change.

It is possible that this breaks users that have not migrated themselves, for example if Flame ever does something like if (myParameter is TextButton) {... where TextButton comes from material_ui.dart, but a user passed in a TextButton from material.dart.

Migration instructions

The migration instructions are the same for non-Flame apps: https://docs.flutter.dev/release/breaking-changes/material-ui-and-cupertino-ui

Related Issues

flutter/flutter#192957
flutter/tests#497
rrousselGit/provider#924

@justinmc justinmc changed the title [chore] Migrate decoupling chore: Migrate decoupling Sep 29, 2026

@spydon spydon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Great, lgtm! Can you just fix the analyzer error?

Dashbook uses material.dart, so its themeData parameter expects a
ThemeData from the SDK and won't accept one from material_ui. To avoid
needing to migrate them too, I have left off the parameter, changing the
examples to light mode.
Comment thread examples/lib/main.dart
@spydon
spydon enabled auto-merge (squash) September 29, 2026 21:28
@spydon
spydon merged commit 76c8e81 into flame-engine:main Sep 29, 2026
8 checks passed
@lea108

lea108 commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

For some packages I don't think material_ui is necessary as a dependency. It just was material by default before. But seeing that this has been merged already we'll have to tidy up that later.

@spydon

spydon commented Sep 30, 2026

Copy link
Copy Markdown
Member

For some packages I don't think material_ui is necessary as a dependency. It just was material by default before. But seeing that this has been merged already we'll have to tidy up that later.

That's true, feel free to submit a PR if you want to. :)

spydon pushed a commit that referenced this pull request Sep 30, 2026
Removes dependency material_ui introduced by
#4066 on a few packages where
foundation.dart or widgets.dart in the framework provide the same
functionality as via material_ui package.

Some examples and tests still uses material_ui. There are also packages
which depend on material_ui for Colors which I haven't touched (yet).
@lea108 lea108 mentioned this pull request Sep 30, 2026
5 of 6 tasks
spydon pushed a commit that referenced this pull request Sep 30, 2026
Removes dependency material_ui introduced by
#4066 in flame_console package
by extracting white and black from Colors class.
@justinmc
justinmc deleted the migrate-decoupling branch September 30, 2026 19:40
spydon added a commit that referenced this pull request Sep 30, 2026
## Description

The decoupling migration in #4066 added `material_ui: any` to every
package. `dart pub publish` refuses an unconstrained dependency, so the
`Prepare release` workflow fails during the dry run:


https://github.com/flame-engine/flame/actions/runs/36740924859/job/109974817579

This constrains it to `^1.0.0` everywhere. All packages already require
Flutter `>=3.44.0`, which is the first stable that ships with
`material_ui` 1.x, so this matches the existing environment without
narrowing it further. The resolved version in the lockfile is unchanged.

## Checklist

- [x] I have followed the [Contributor Guide] when preparing my PR.
- [x] I have updated/added tests for ALL new/updated/fixed
functionality.
- [x] I have updated/added relevant documentation in `docs` and added
dartdoc comments with `///`.
- [x] I have updated/added relevant examples in `examples` or `docs`.

## Breaking Change?

- [ ] Yes, this PR is a breaking change.
- [x] No, this PR is not a breaking change.

[Contributor Guide]:
https://github.com/flame-engine/flame/blob/main/CONTRIBUTING.md
SERDUN added a commit to SERDUN/flame that referenced this pull request Oct 1, 2026
On Flutter 3.47 dashbook 0.1.19 takes ThemeData from material_ui, so
passing it the framework's ThemeData failed to compile and the examples
app did not build at all. Taken from upstream 76c8e81 (flame-engine#4066): main.dart
imports material_ui and dashbook keeps its own theme.
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.

3 participants