From 5599e2cdb3947fed7c640e5513efbec557617d61 Mon Sep 17 00:00:00 2001 From: Sahil Kumar Date: Mon, 17 Aug 2026 11:36:19 +0200 Subject: [PATCH 1/7] docs(repo): add the flutter-version-bump skill Adopting a new Flutter stable and raising the published minimum are two different jobs that share the phrase "bump Flutter", and the second one is due on a fixed policy (minimum supported = latest stable - 1) rather than when something breaks. The skill separates them and records what this repo's CI actually checks, since most of the traps come from gaps between the jobs: - A floor raise moves two knobs, not three: `melos.yaml` (source of truth, propagated by `melos bs`) and `legacy_version_analyze.yml`. There is no `.fvmrc` here, so nothing pins a developer's toolchain to the floor. - Alchemist keys on `GITHUB_ACTIONS`, not the more common `CI`, so the obvious local invocation runs the untracked platform goldens and fails every golden test for reasons unrelated to the toolchain. - `package_analysis` analyzes `stream_core/lib` only, with `--fatal-warnings`. The beta canary and the N-1 job therefore say nothing about the Flutter packages, and nothing at all about the new infos that `--fatal-infos` turns into failures. - `all_lint_rules.yaml` is an explicit list, so a new SDK's rules never self-activate, and a removed rule surfaces as `undefined_lint` in that file rather than in `analysis_options.yaml`. - Raising the Dart constraint raises each package's language version, which wakes lints whose fix was not previously expressible. `dart fix` applies them mechanically and rewrites or deletes doc comments while doing so, so the diff needs reading in both directions. - Nothing in CI builds for Android or iOS, so platform build floors are invisible here and must not be reported as verified. Co-Authored-By: Claude Opus 5 (1M context) --- .claude/skills/flutter-version-bump/SKILL.md | 482 +++++++++++++++++++ 1 file changed, 482 insertions(+) create mode 100644 .claude/skills/flutter-version-bump/SKILL.md diff --git a/.claude/skills/flutter-version-bump/SKILL.md b/.claude/skills/flutter-version-bump/SKILL.md new file mode 100644 index 00000000..b7c4701e --- /dev/null +++ b/.claude/skills/flutter-version-bump/SKILL.md @@ -0,0 +1,482 @@ +--- +name: flutter-version-bump +description: > + Adopt a new Flutter stable release in this monorepo — diagnose and fix the analyze, format, golden, and barrel + failures a new toolchain introduces, then raise the published minimum Flutter/Dart floor to the SDK's + "latest stable − 1" policy. Use when CI suddenly goes red after a Flutter release, when + `dart analyze --fatal-infos` reports diagnostics that did not exist before, when goldens drift after upgrading, + or when asked to "support Flutter X" or "bump the min Flutter version". +allowed-tools: + - Bash + - Read + - Edit + - Write + - Grep + - Glob +--- + +# flutter-version-bump + +Two different jobs share the phrase "bump Flutter". Decide which one you are doing **before** touching a file — +they produce different diffs, different review burdens, and only one of them changes what consumers can resolve. + +| Track | Goal | Scope | Consumer impact | +|---|---|---|---| +| **A — Compat** (first) | Make CI green on the new stable | Source fixes, lint config, goldens | None | +| **B — Floor raise** (policy-driven) | Move the minimum to latest − 1 | 6 pubspecs + `melos.yaml` + `legacy_version_analyze.yml` + CHANGELOGs + newly-activated lints | Apps below the floor stop resolving | + +A floor raise is **not** a breaking change: no `!` in the commit/PR title, and the CHANGELOG bullet does not go +under `### 🛑 Breaking / Removals`. Existing code keeps compiling; older SDKs simply stop resolving the new +version. Do not invent a `!` for it. + +**Do Track A first, always.** "CI broke after the new Flutter came out" is Track A, and it must land green before +Track B starts — otherwise you cannot tell a floor-raise failure from a new-stable failure. + +**Then check whether Track B is due.** The SDK's policy is **minimum supported = latest stable − 1**, so a new +stable makes the floor raise *routine, not exceptional*: when 3.47 shipped, the floor moved 3.38 → **3.44**. Pair +each Flutter minor with its Dart SDK (3.44 → Dart 3.12, 3.47 → Dart 3.13); `fvm releases` lists both, and the +authoritative list is +`https://storage.googleapis.com/flutter_infra_release/releases/releases_macos.json` (`fvm`'s cache goes stale). + +Track B belongs in a minor/major release rather than a hotfix, and must be its own commit — its diff has nothing +to do with the compat fixes. + +Only **two** version knobs move on a floor raise here, and they are both the *floor*, never the new stable: + +| Knob | Value | +|---|---| +| `melos.yaml` `command.bootstrap.environment` | the new floor — source of truth, `melos bs` propagates to every pubspec | +| `.github/workflows/legacy_version_analyze.yml` `env.flutter_version` | the new floor — this job *is* the floor's regression test | + +> The repo has **no `.fvmrc`** — local Flutter selection is not pinned here. Do not create one as a side effect of +> a version bump; that is its own decision. It does mean nothing forces a developer's local toolchain to be the +> floor, so newer-than-floor API usage is caught only by `legacy_version_analyze`, which analyzes +> **`stream_core/lib` only** (see below). Analyse against the floor by hand. + +## Why CI breaks the day a Flutter stable ships + +`.github/workflows/stream_core_flutter_workflow.yml` installs Flutter with + +```yaml +channel: ${{ env.FLUTTER_CHANNEL }} # stable — no version pin +``` + +so both jobs (`analyze` and `test`) **auto-adopt the new stable within hours of release**. +`legacy_version_analyze.yml` (the N-1 canary) pins a version and does *not* follow. So the first symptom is always +"CI went red and nobody changed anything", while a local machine on an older SDK still passes. + +`melos run analyze` runs `dart analyze --fatal-infos` (examples excluded). New SDKs ship new diagnostics as +**infos and warnings**, which `--fatal-infos` turns into hard failures. That is why an SDK bump hurts here more +than in a typical repo. + +### Check the canary first — it usually already told you + +`beta_version_analyze.yml` runs the `package_analysis` action against the **beta** channel every Monday and Slacks +on failure. Beta becomes stable roughly a quarter later, so this workflow reports the next release's analyzer +failures *months* early. Before investigating anything, read its history: + +```bash +gh run list --workflow=beta_version_analyze.yml --limit 10 +gh run view --log-failed | grep -E "warning -|info -|error" +``` + +Two traps when reading it, both because `.github/actions/package_analysis/action.yml` is a **one-package action**: + +```bash +cd packages/stream_core/lib && dart analyze --fatal-warnings . && cd .. && flutter test --exclude-tags golden +``` + +- **It only covers `stream_core`.** `stream_core_flutter`, `stream_thumbnail` and the gallery are never analysed + by the canary or by `legacy_version_analyze`. A green canary says nothing about the Flutter packages. +- **It is `--fatal-warnings`, not `--fatal-infos`,** and `lib/` only. New *infos* — the bulk of what a new SDK + ships — pass the canary and fail `melos run analyze`. + +If the canary has been red and unactioned for weeks, that is the most valuable finding in the exercise — report it +separately from the code fixes. + +## Step 1 — Branch off main + +Never branch a toolchain bump off a feature branch. Bootstrap rewrites lockfiles repo-wide. + +```bash +git fetch origin +git checkout -b chore/flutter- origin/main +``` + +## Step 2 — Install the new SDK side by side + +Keep the old one. Every claim below is an A/B comparison, and you cannot make one with a single toolchain. + +```bash +fvm install # e.g. 3.47.0 +fvm list # confirm old + new are both cached +NEW=~/fvm/versions/ +OLD=~/fvm/versions/ +``` + +On a floor raise you want **three**: the old floor, the new floor (must analyse clean — it is what +`legacy_version_analyze` will run) and the latest stable (what CI's `analyze` job actually resolves to). + +## Step 3 — Measure before you fix + +The single most important habit: **never attribute a failure to the new SDK without seeing the old SDK pass it.** +Repos accumulate drift; a feature branch may already be dirty; a local `build/` directory can inject hundreds of +phantom issues. Run each check under both toolchains and diff. + +### Format + +CI runs `melos run format:verify` → `dart format --set-exit-if-changed .` from the root, which walks untracked +trees too. Scope to tracked files so `build/` noise cannot pollute the comparison: + +```bash +git ls-files '*.dart' > /tmp/dartfiles.txt +for V in $OLD $NEW; do + echo "== $V" + $V/bin/cache/dart-sdk/bin/dart format --output=none --set-exit-if-changed $(cat /tmp/dartfiles.txt) 2>&1 | tail -3 +done +``` + +The root `analysis_options.yaml` sets `page_width: 120` and `trailing_commas: preserve`; `dart format` reads it +from the file nearest the target, so always format from the repo root, never from inside a package with its own +options file. + +Interpretation: + +- **Both 0 changed** → the formatter did not change. Do not touch formatting in this PR. +- **New > 0, old = 0** → `dart_style` changed. Apply it as an **isolated commit** touching nothing else, so the + real fixes stay reviewable. +- **Old > 0, new = 0** → the repo is already formatted for a newer formatter than the floor. Pre-existing drift, + harmless. Not yours to fix here — but mention it. + +### Analyze + +> **Run `melos bootstrap` first, and re-run it after every pubspec edit.** `dart analyze` reads the *language +> version* from `.dart_tool/package_config.json`, written by `pub get` — **not** from `pubspec.yaml`. A stale +> `.dart_tool` reports a confidently clean result that CI will not reproduce, and editing an SDK constraint +> without re-bootstrapping changes nothing at all. Verify with: +> +> ```bash +> python3 -c "import json;d=json.load(open('packages/stream_core_flutter/.dart_tool/package_config.json'));\ +> print([p.get('languageVersion') for p in d['packages'] if p['name']=='stream_core_flutter'])" +> ``` +> +> Despite the root `pubspec.yaml` being named `stream_core_flutter_workspace`, this is **not** a pub workspace — +> no package declares `resolution: workspace`. Melos bootstraps each package separately, so every package has its +> own `.dart_tool/package_config.json` and you must check the one you care about. + +Mirror `melos run analyze` (`--fatal-infos`, examples excluded) and **filter local build artifacts**, which are +not in CI and will otherwise bury the real signal: + +```bash +set -o pipefail # otherwise a matching grep masks an analyzer that crashed +for V in $OLD $NEW; do + echo "##### $V" + for p in packages/stream_core packages/stream_core_flutter packages/stream_thumbnail apps/design_system_gallery; do + echo "### $p" + # `|| true` so a package with no diagnostics is not reported as a failure + (cd "$p" && $V/bin/cache/dart-sdk/bin/dart analyze --fatal-infos . 2>&1 \ + | { grep -E "^\s+(info|warning|error)" | grep -v " build/" || true; }) + done +done +``` + +Everything present under `$NEW` and absent under `$OLD` is your work list. Everything in both is pre-existing — +leave it alone and say so. + +### Tests and goldens — `GITHUB_ACTIONS=true` is mandatory + +`packages/stream_core_flutter/test/flutter_test_config.dart` switches alchemist on **`GITHUB_ACTIONS` only** — +not the more common `CI`. Setting `CI=true` looks right and silently runs the *platform* variant instead: + +```dart +final isRunningInCi = Platform.environment.containsKey('GITHUB_ACTIONS'); +ciGoldensConfig: CiGoldensConfig(enabled: isRunningInCi), +platformGoldensConfig: PlatformGoldensConfig(enabled: !isRunningInCi), +``` + +**Only `goldens/ci/` is committed** (47 files). A bare `flutter test` on your machine runs the platform variant, +whose goldens do not exist in the repo, and fails every golden test for reasons that have nothing to do with the +new SDK. Always: + +```bash +for V in $OLD $NEW; do + (cd packages/stream_core_flutter && GITHUB_ACTIONS=true $V/bin/flutter test --reporter=compact > /tmp/t-$(basename $V).log 2>&1) +done +# compare the failure sets, not the counts — `\r` matters, the compact reporter uses it +for V in $OLD $NEW; do + tr '\r' '\n' < /tmp/t-$(basename $V).log | grep -E '\[E\]$' | sed 's|.*/test/|test/|' | sort -u \ + > /tmp/fail-$(basename $V).txt +done +comm -13 /tmp/fail-$(basename $OLD).txt /tmp/fail-$(basename $NEW).txt # caused by the new SDK +comm -12 /tmp/fail-$(basename $OLD).txt /tmp/fail-$(basename $NEW).txt # pre-existing, out of scope +``` + +Repeat for `packages/stream_core` (pure Dart, no goldens). + +Committed goldens are Linux-rendered, so some fail on macOS even on the old SDK. That baseline noise is exactly +what `comm` separates out. **Only the lines the new SDK adds are yours.** + +> **Never run `git checkout -- .` between runs.** Alchemist only writes untracked `failures/*.png` directories, +> so there is nothing to revert — and a blanket checkout silently destroys the source fixes you just made. Clean +> up with `git clean -fd -- '*/failures'` instead, and keep `git status --short` in view. + +### Barrels + +`melos run check:barrels` gates the PR alongside analyze. It is not toolchain-sensitive on its own, but a fix +that moves or adds a file under `packages/stream_core_flutter/lib/src/` breaks it. Run it in the same breath as +analyze. + +## Step 4 — Fix, by failure class + +Work the diff from Step 3. Known classes and this repo's chosen remedy: + +### New analyzer diagnostics (the usual bulk) + +New SDKs add diagnostics that `--fatal-infos` promotes to failures. Treat each as a real finding first — most of +them point at a genuine latent bug — and only suppress when the diagnostic is wrong about this code. + +| Remedy | When | +|---|---| +| Fix the code | Default. The diagnostic is usually right. | +| `// ignore: ` with a one-line reason above it | The diagnostic is correct in general but wrong here, or the fix belongs to an upstream package. Never a bare ignore — see `STYLE_GUIDE.md`. | +| Flip the rule to `false` in `analysis_options.yaml`, or delete it from `all_lint_rules.yaml` | The lint was **removed or renamed** by the SDK. An unrecognized rule name is itself a warning. | + +The lint config here is inverted relative to most repos: `all_lint_rules.yaml` is an **explicit list of every +rule**, included wholesale, and `analysis_options.yaml` then switches individual rules back to `false` with a +comment saying why. Two consequences: + +- **A new SDK's new rules do not activate on their own.** The list is static, so adopting them means adding the + names to `all_lint_rules.yaml` — a code-style decision with its own before/after numbers, and **always its own + PR**, never this one. +- **A removed or renamed rule fires `undefined_lint` in `all_lint_rules.yaml`, not in `analysis_options.yaml`.** + Delete it there; if `analysis_options.yaml` also disables it, delete that line too or it becomes the next + `undefined_lint`. + +To find removed/renamed/deprecated lints mechanically rather than by guessing, analyse the options files +themselves — `melos run analyze` never does, because both sit at the repo **root**, outside every melos package: + +```bash +for V in $OLD $NEW; do + echo "== $V"; $V/bin/cache/dart-sdk/bin/dart analyze --fatal-infos analysis_options.yaml all_lint_rules.yaml +done +``` + +`undefined_lint` means the rule was removed or renamed — a hard failure once the root is analysed. +`deprecated_lint` means it still parses but is on its way out — cheaper to drop now than to discover as +`undefined_lint` two releases later. Run it under both toolchains: a `deprecated_lint` that also fires on the old +SDK is pre-existing debt, not something this release introduced. + +### Framework deprecations + +New `deprecated_member_use` infos are fatal here. Prefer migrating to the replacement API. If the replacement does +not exist on the floor in `melos.yaml`, you cannot use it — suppress with a scoped ignore naming the reason, and +leave the migration for the release that raises the floor. + +### New runtime assertions + +Flutter adds asserts that only fire in tests, so they surface as widget-test failures, not analyzer output. Read +the assertion and fix the widget tree; do not silence the test. + +### Golden pixel drift + +Small diffs (well under 1%) across unrelated widgets mean the engine's rasterisation changed — legitimate, and the +goldens must be regenerated. Larger diffs confined to one widget family usually mean a real layout change; +investigate before regenerating. **On a Track B floor raise, goldens should not move at all** — CI still runs the +latest stable either way. If they do, that is a signal to investigate, not to regenerate. + +**Goldens are always regenerated by the CI workflow — never locally. No exceptions.** + +`melos run update:goldens` writes the *platform* variant on your machine; the committed `goldens/ci/*.png` are +Linux-rendered. Regenerating locally therefore produces macOS pixels the repo does not even track. Locally you may +**compare** (`GITHUB_ACTIONS=true flutter test`) to see which goldens moved — never write them. + +`update_goldens.yml` checks out with `secrets.BOT_SSH_PRIVATE_KEY` and commits `**/test/**/goldens/*.png` back to +whatever branch you dispatch against, so **push the branch first**. It has no inputs — it always regenerates +everything, on `ubuntu-latest`, with `flutter-version: "3.x"` (the new stable, automatically). + +> **Confirm with the user before running this.** It pushes a branch and dispatches a workflow that writes a commit +> to the remote. It is the one outward-facing action in this skill — never dispatch it unprompted, and expect the +> branch to stay red on goldens until it has run. + +```bash +git push -u origin chore/flutter- +gh workflow run update_goldens.yml --ref chore/flutter- +gh run watch $(gh run list --workflow=update_goldens.yml --limit 1 --json databaseId --jq '.[0].databaseId') +git pull # pick up the bot's "chore: Update Goldens" commit +``` + +Two consequences to state plainly when you report: + +- **The branch is not verifiable-green on macOS.** Even after regeneration, a local `GITHUB_ACTIONS=true` run + still shows the pre-existing Linux-vs-macOS baseline diffs from Step 3. Give the reviewer that number so a + non-zero local failure count is not read as "the fix did not work". +- `legacy_version_analyze.yml` never runs golden tests, so regenerating against the new stable cannot break the + N-1 canary. + +### Files the toolchain rewrites underneath you + +`melos bootstrap` and `flutter pub get` both edit tracked files. Anything they rewrite that you do not commit +fails the **format** job, since `melos run format:verify` runs after bootstrap in CI. + +- **`pubspec.lock`** — the workspace has a single root lock. Commit it. +- **`analyzer.exclude` blocks injected into an app-type `analysis_options.yaml`** — Flutter 3.47's `pub get` + writes `build/`, `android/`, `ios/`, … exclusions into packages that have a `flutter:` SDK dep *and* platform + directories (here: `apps/design_system_gallery`, `packages/stream_thumbnail/example`). It is tool-authored + config, not ours. **Surface it, do not decide it yourself** — and note that `pub get` *merges* its full list + into any existing `exclude:`, so a hand-trimmed version is not a stable fixed point. +- **`test_api: any` / `flutter_test: any` appended to `dev_dependencies`** — melos injects these around bootstrap + and normally strips them again. **Never commit them**: `flutter_test` has no pub.dev version, so committing it + makes the next `melos bootstrap` fail version solving outright. + +There are **no Android/iOS build jobs** in this repo's CI — nothing compiles the gallery or the thumbnail example +for a device. So Gradle/AGP/Kotlin/Xcode floors never gate a PR here, and a new Flutter's raised build-tool floors +are invisible until someone builds locally. Say that rather than implying the platform projects are verified. + +## Step 5 — Verify like CI does + +```bash +melos bootstrap +melos run analyze +melos run check:barrels +melos run format:verify +GITHUB_ACTIONS=true melos run test:all +git status --short # expect only your intended edits +git clean -fdn -- '*/failures' # review, then drop -n to remove alchemist's diff images +``` + +Two things will still look wrong locally and are not: + +- `melos run analyze` surfaces `build/` noise if you have ever built the gallery. Compare against Step 3's + baseline instead of expecting a clean zero. +- `GITHUB_ACTIONS=true melos run test:all` still fails the pre-existing Linux-vs-macOS goldens. Compare failure + **sets**, not counts. + +Also re-check the floor, since `legacy_version_analyze.yml` gates the PR — and remember it covers `stream_core` +only, so extend it by hand to the packages it misses: + +```bash +for p in packages/*/; do (cd "$p/lib" && $FLOOR/bin/cache/dart-sdk/bin/dart analyze --fatal-infos .); done +``` + +A fix that relies on syntax newer than the floor passes on `$NEW` and fails that job. + +## Step 6 — Track B: raise the floor to latest − 1 + +Keep this out of the Track A commit — it changes what consumers can resolve and needs to be reviewable on its own. + +Version-carrying files, all of which must move together. **Derive the list by grep, do not trust this one** — it +is accurate as of the 3.44 raise: + +```bash +git ls-files '*pubspec.yaml' | xargs grep -ln 'sdk: \^3\.' +``` + +- `melos.yaml` — `command.bootstrap.environment.{sdk,flutter}` (the source of truth; `melos bs` propagates) +- `pubspec.yaml` (root workspace) — `environment.sdk` only; the root carries no `flutter` constraint +- `packages/stream_core/pubspec.yaml` — `sdk` only. It is **pure Dart and carries no `flutter` constraint — do + not add one.** +- `packages/stream_core_flutter/pubspec.yaml` — `sdk` + `flutter` +- `packages/stream_thumbnail/pubspec.yaml` and `packages/stream_thumbnail/example/pubspec.yaml` +- `apps/design_system_gallery/pubspec.yaml` +- `.github/workflows/legacy_version_analyze.yml` — `env.flutter_version`. Set it to the **new floor** (never the + new stable): this job exists to prove the floor still analyses clean. Note the existing value may be a *patch* + of the floor (`3.38.10` for a `>=3.38.1` floor) — pick one convention, say which in the commit message. + +Confirm melos actually propagated rather than assuming it: + +```bash +melos bootstrap && git diff --stat -- '*pubspec.yaml' +``` + +Melos only rewrites keys that already exist, so a pubspec missing a `flutter:` key stays missing one — which is +what you want for `stream_core`, and what you must fix by hand anywhere it is wrong. + +### The floor raise activates dormant lints — budget for it + +This is the step that surprises people. Raising the Dart constraint raises each package's **language version**, +and lints stay silent while their suggested fix is not yet expressible. Raise the floor and they all fire at once, +in code nobody touched. + +Concretely, the Dart 3.10 → 3.12 raise activated `prefer_initializing_formals` on 24 sites across +`stream_core`, `stream_core_flutter` and the gallery, because Dart 3.12 legalised `this._privateField` as a named +parameter. Zero issues before, 24 after — none of it caused by the new *stable*, all of it caused by the *floor*. + +So: **`melos bootstrap` and re-analyse immediately after editing the constraints**, before you write the +CHANGELOG. Then let the tooling do the mechanical work: + +```bash +for p in packages/*/ apps/design_system_gallery; do (cd $p && dart fix --dry-run); done +# then, per lint, once you have decided the fix is right: +(cd && dart fix --apply --code=prefer_initializing_formals) +``` + +Two things to check by hand afterwards — `dart fix` is mechanical, not thoughtful: + +- **Doc comments get mangled *and silently deleted*.** It rewrites `[logger]` to `[_logger]` in the doc above the + constructor — leaking a private name into public API docs, when callers still pass the *public* name + (`logger:`, underscore stripped). It also drops any `///` comment attached to the parameter it rewrites. Review + every comment line the refactor touched, in both directions: + + ```bash + git diff -- '*.dart' | grep -E "^[-+]\s*(///|//)" + ``` + + Checking only added lines misses the deletions — that is how a lost doc comment survives review. +- **Confirm no public parameter was renamed.** For every `this._foo` it introduced, the parameter it replaced must + have been named exactly `foo`. A mismatch is a silent breaking change for callers — and in this repo a public + widget or theme constructor is API that downstream SDKs (`stream-chat-flutter`, `stream-video-flutter`) depend + on. + +This repo generates heavily (`json_serializable`, `theme_extensions_builder`). Re-run `melos run generate:all` +afterwards and confirm the generated call sites are unchanged — the generators read constructor parameters, so a +renamed parameter would silently change `.g.dart` / `.g.theme.dart`. + +**Always `dart format` after build_runner.** Generated files carry a `// dart format width=80` marker and are +emitted at 80 columns while the repo's `analysis_options.yaml` sets `page_width: 120`, so a regen can dirty +generated files with pure reflow. Format before concluding codegen "changed" anything. Note the root analyzer +`exclude` covers `packages/*/lib/**/*.*.dart`, so generated files are not analysed — but they *are* formatted. + +Then, per `STYLE_GUIDE.md`, one short bullet under `## Upcoming` in each published package's CHANGELOG: + +```md +- Raised minimum Flutter to `>=X.Y.Z` and Dart SDK to `^A.B.C`. +``` + +`stream_core` is Dart-only — its bullet mentions the Dart SDK only. `apps/design_system_gallery` is not published +and has no CHANGELOG. The style guide's heading list (`### ✨ Features`, `### 🐛 Bug Fixes`, +`### 🛑 Breaking / Removals`, `### ⚠️ Deprecations`) has no "changed" bucket; a floor raise is **not** breaking, so +use `### 🔄 Changed` and update `STYLE_GUIDE.md` if you introduce it. + +Two CI gates read the CHANGELOG and will bite: + +- `semantic_changelog_update` in `pr_title.yml` maps scopes `llc`/`ui`/`thumb` to packages. A `chore(repo):` PR is + outside that map, so it is not *required* to touch a changelog — but if you do touch one, `changelog_placement` + requires the entries to be under `## Upcoming`, not under an already-published version heading. +- A package that was just released may have **no `## Upcoming` section at all**. Add one at the top rather than + filing the bullet under the released version — that is precisely what `changelog_placement` fails on. + +Finish with `melos bootstrap` and commit the resulting root `pubspec.lock`. + +## Step 7 — Changelog and PR + +Track A changes that are user-visible (a widget swapped, a deprecation migrated) get a CHANGELOG bullet in the +affected package. Pure CI/tooling/golden churn does not. + +PR title follows Conventional Commits with a **required scope** from `llc` / `ui` / `repo` / `thumb` +(`pr_title.yml` enforces it): + +- Track A → `chore(repo): support Flutter ` +- Track B → `chore(repo): bump min Flutter to and Dart SDK to ` + +## Report back with attribution + +When summarising, always separate the three buckets — it is the difference between a reviewable PR and a mystery: + +1. **Caused by the new SDK** (present on new, absent on old) — what this PR fixes. +2. **Pre-existing** (present on both) — explicitly out of scope, named so nobody re-investigates. +3. **Local-only noise** (`build/` artifacts, platform goldens without `GITHUB_ACTIONS=true`) — never appears in + CI, never fix. + +Say plainly what you could not verify. Here that is a short list — there are no build jobs — but +`legacy_version_analyze` covering only `stream_core` means "the canary is green" is a much weaker claim than it +sounds. From c1c71362a2221a3783e9e59c69e68bf1a7fa7f32 Mon Sep 17 00:00:00 2001 From: Sahil Kumar Date: Mon, 17 Aug 2026 12:11:41 +0200 Subject: [PATCH 2/7] chore(repo): bump min Flutter to 3.44.0 and Dart SDK to 3.12.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flutter 3.47.0 went stable on 2026-08-12, so the "minimum supported = latest stable - 1" policy makes 3.44.0 (Dart 3.12.0) the new floor, up from 3.38.1 / 3.10.0. This is Track B only: CI already runs the new stable and is green on it, so no compat work was needed first. A floor raise is not breaking — existing code keeps compiling, older SDKs simply stop resolving the new version — so there is no `!` and the bullets go under a `🔄 Changed` heading. That heading had no entry in STYLE_GUIDE's list, which covered only features, fixes and removals; it is added there with the rule that a floor raise belongs under it rather than under `🛑 Breaking / Removals`. Two knobs move in lockstep: `melos.yaml`, which is the source of truth and propagates to all five package pubspecs on bootstrap, and `legacy_version_analyze.yml`, whose `flutter_version` is the floor's own regression test. That job was pinned to `3.38.10`, a patch of the old floor rather than the floor itself; it now names the floor exactly, so what CI proves is what the pubspecs claim. Raising the Dart constraint raises each package's language version, which activated `prefer_initializing_formals` on 24 previously-silent sites: Dart 3.12 legalised `this._privateField` as a named parameter, so the lint's suggested fix only became expressible now. Zero issues before the constraint moved, 24 after — caused by the floor, not by the new stable. Applied with `dart fix --apply --code=prefer_initializing_formals` and then audited by hand, since the fix is mechanical: - It rewrote five doc-comment references to the private field name (`[cdn]` -> `[_cdn]`), which would have leaked private names into public API docs while callers still pass the public name. Reverted; the diff now touches no comment line in either direction. - Every introduced `this._foo` replaced a parameter named exactly `foo`, so no public parameter was renamed. `melos run generate:all` produces no diff, confirming the generators still see the same names. Verified at both ends: `dart analyze --fatal-infos` is clean across all four packages on 3.47.0 (what CI resolves) and reports only one pre-existing info on 3.44.0 (the floor). `stream_core` 317 tests and `stream_thumbnail` 10 tests pass; `stream_core_flutter` fails the same 42 macOS-vs-Linux goldens as before the change, an identical set, so no golden was regenerated. Barrels and formatting pass. Co-Authored-By: Claude Opus 5 (1M context) --- .github/workflows/legacy_version_analyze.yml | 2 +- STYLE_GUIDE.md | 9 +++++++ .../lib/config/theme_configuration.dart | 4 +-- apps/design_system_gallery/pubspec.yaml | 4 +-- melos.yaml | 4 +-- packages/stream_core/CHANGELOG.md | 4 +++ .../src/api/system_environment_manager.dart | 4 +-- .../uploader/attachment_uploader.dart | 4 +-- .../lib/src/user/token_manager.dart | 4 +-- .../engine/stream_web_socket_engine.dart | 8 +++--- .../connection_recovery_handler.dart | 3 +-- .../ws/client/web_socket_health_monitor.dart | 4 +-- packages/stream_core/pubspec.yaml | 2 +- packages/stream_core_flutter/CHANGELOG.md | 6 +++++ .../common/stream_intrinsic_flex.dart | 26 +++++++------------ .../components/common/stream_safe_area.dart | 7 +++-- .../common/stream_tap_target_padding.dart | 11 +++----- .../src/components/sheet/stream_sheet.dart | 7 +++-- .../src/factory/stream_component_factory.dart | 4 +-- packages/stream_core_flutter/pubspec.yaml | 4 +-- packages/stream_thumbnail/CHANGELOG.md | 6 +++++ .../stream_thumbnail/example/pubspec.yaml | 4 +-- packages/stream_thumbnail/pubspec.yaml | 4 +-- pubspec.lock | 2 +- pubspec.yaml | 2 +- 25 files changed, 74 insertions(+), 65 deletions(-) diff --git a/.github/workflows/legacy_version_analyze.yml b/.github/workflows/legacy_version_analyze.yml index 32374d25..76940ddf 100644 --- a/.github/workflows/legacy_version_analyze.yml +++ b/.github/workflows/legacy_version_analyze.yml @@ -3,7 +3,7 @@ name: legacy_version_analyze env: # Note: The versions below should be manually updated after a new stable # version comes out. - flutter_version: "3.38.10" + flutter_version: "3.44.0" on: push: diff --git a/STYLE_GUIDE.md b/STYLE_GUIDE.md index d124e397..4efd5389 100644 --- a/STYLE_GUIDE.md +++ b/STYLE_GUIDE.md @@ -1352,12 +1352,21 @@ sub-headings: - Fixed a crash when opening the media viewer with an empty attachments list. +### 🔄 Changed + +- Raised the minimum Flutter version to `>=3.44.0` and the Dart SDK to `^3.12.0`. + ### 🛑 Breaking / Removals - Removed `StreamCoreMessageComposer`. Use `StreamMessageComposer` from `stream_chat_flutter` instead. ``` +`### 🔄 Changed` covers what is neither new API nor a fix and does not break +existing code — a raised minimum Flutter/Dart version, a tightened dependency +constraint, a changed default. A raised floor is **not** breaking: code keeps +compiling, older SDKs simply stop resolving the new version. + Prefer **one short bullet** per entry, describing the functional change. Longer entries are acceptable for user-visible multi-facet features where the extra context matters to someone deciding whether to upgrade — but avoid sub-bullets, diff --git a/apps/design_system_gallery/lib/config/theme_configuration.dart b/apps/design_system_gallery/lib/config/theme_configuration.dart index 733359e7..3e162514 100644 --- a/apps/design_system_gallery/lib/config/theme_configuration.dart +++ b/apps/design_system_gallery/lib/config/theme_configuration.dart @@ -7,8 +7,8 @@ import 'package:stream_core_flutter/core.dart'; /// exact naming conventions from [StreamColorScheme]. class ThemeConfiguration extends ChangeNotifier { ThemeConfiguration({ - Brightness brightness = Brightness.light, - }) : _brightness = brightness { + this._brightness = Brightness.light, + }) { _rebuildTheme(); } diff --git a/apps/design_system_gallery/pubspec.yaml b/apps/design_system_gallery/pubspec.yaml index c3fb8d38..d9af0fac 100644 --- a/apps/design_system_gallery/pubspec.yaml +++ b/apps/design_system_gallery/pubspec.yaml @@ -4,8 +4,8 @@ publish_to: 'none' version: 1.0.0+1 environment: - sdk: ^3.10.0 - flutter: ">=3.38.1" + sdk: ^3.12.0 + flutter: ">=3.44.0" dependencies: device_frame_plus: ^1.0.0 diff --git a/melos.yaml b/melos.yaml index 17b97ecb..adda26e6 100644 --- a/melos.yaml +++ b/melos.yaml @@ -12,9 +12,9 @@ command: bootstrap: # Dart and Flutter environment used in the project. environment: - sdk: ^3.10.0 + sdk: ^3.12.0 # We are not using carat '^' syntax here because flutter don't follow semantic versioning. - flutter: ">=3.38.1" + flutter: ">=3.44.0" # List of all the dependencies used in the project. dependencies: diff --git a/packages/stream_core/CHANGELOG.md b/packages/stream_core/CHANGELOG.md index 7e039175..3a90f784 100644 --- a/packages/stream_core/CHANGELOG.md +++ b/packages/stream_core/CHANGELOG.md @@ -4,6 +4,10 @@ - Added `teams` field to `User` class. +### 🔄 Changed + +- Raised the minimum Dart SDK to `^3.12.0`. + ## 0.4.0 ### 💥 BREAKING CHANGES diff --git a/packages/stream_core/lib/src/api/system_environment_manager.dart b/packages/stream_core/lib/src/api/system_environment_manager.dart index 086e497c..96986bdc 100644 --- a/packages/stream_core/lib/src/api/system_environment_manager.dart +++ b/packages/stream_core/lib/src/api/system_environment_manager.dart @@ -8,8 +8,8 @@ import 'system_environment.dart'; class SystemEnvironmentManager { /// {@macro systemEnvironmentManager} SystemEnvironmentManager({ - required SystemEnvironment environment, - }) : _environment = environment; + required this._environment, + }); /// Returns the Stream client user agent string based on the current /// [environment] value. diff --git a/packages/stream_core/lib/src/attachment/uploader/attachment_uploader.dart b/packages/stream_core/lib/src/attachment/uploader/attachment_uploader.dart index a6603068..a02b1182 100644 --- a/packages/stream_core/lib/src/attachment/uploader/attachment_uploader.dart +++ b/packages/stream_core/lib/src/attachment/uploader/attachment_uploader.dart @@ -53,8 +53,8 @@ class AttachmentUploadException implements Exception { class StreamAttachmentUploader { /// Creates a [StreamAttachmentUploader] with the specified [cdn] client. const StreamAttachmentUploader({ - required CdnClient cdn, - }) : _cdn = cdn; + required this._cdn, + }); // The CDN client used for upload operations. final CdnClient _cdn; diff --git a/packages/stream_core/lib/src/user/token_manager.dart b/packages/stream_core/lib/src/user/token_manager.dart index 288f0d4f..aa25ac07 100644 --- a/packages/stream_core/lib/src/user/token_manager.dart +++ b/packages/stream_core/lib/src/user/token_manager.dart @@ -32,8 +32,8 @@ class TokenManager { /// The [tokenProvider] is used to load tokens when needed. TokenManager({ required this.userId, - required TokenProvider tokenProvider, - }) : _tokenProvider = tokenProvider; + required this._tokenProvider, + }); /// The unique identifier of the user whose tokens are managed. final String userId; diff --git a/packages/stream_core/lib/src/ws/client/engine/stream_web_socket_engine.dart b/packages/stream_core/lib/src/ws/client/engine/stream_web_socket_engine.dart index 7a705969..f702ff6f 100644 --- a/packages/stream_core/lib/src/ws/client/engine/stream_web_socket_engine.dart +++ b/packages/stream_core/lib/src/ws/client/engine/stream_web_socket_engine.dart @@ -34,11 +34,9 @@ class StreamWebSocketEngine implements WebSocketEngine { /// Creates a new instance of [StreamWebSocketEngine]. StreamWebSocketEngine({ WebSocketProvider? wsProvider, - WebSocketEngineListener? listener, - required WebSocketMessageCodec messageCodec, - }) : _wsProvider = wsProvider ?? _createWebSocket, - _messageCodec = messageCodec, - _listener = listener; + this._listener, + required this._messageCodec, + }) : _wsProvider = wsProvider ?? _createWebSocket; final WebSocketProvider _wsProvider; final WebSocketMessageCodec _messageCodec; diff --git a/packages/stream_core/lib/src/ws/client/reconnect/connection_recovery_handler.dart b/packages/stream_core/lib/src/ws/client/reconnect/connection_recovery_handler.dart index eb89c0dd..55c4a0af 100644 --- a/packages/stream_core/lib/src/ws/client/reconnect/connection_recovery_handler.dart +++ b/packages/stream_core/lib/src/ws/client/reconnect/connection_recovery_handler.dart @@ -39,12 +39,11 @@ class ConnectionRecoveryHandler extends Disposable { required StreamWebSocketClient client, NetworkStateProvider? networkStateProvider, LifecycleStateProvider? lifecycleStateProvider, - bool keepConnectionAliveInBackground = false, + this._keepConnectionAliveInBackground = false, List? policies, RetryStrategy? retryStrategy, }) : _client = client, _reconnectStrategy = retryStrategy ?? RetryStrategy(), - _keepConnectionAliveInBackground = keepConnectionAliveInBackground, _policies = [ ...?policies, WebSocketAutomaticReconnectionPolicy( diff --git a/packages/stream_core/lib/src/ws/client/web_socket_health_monitor.dart b/packages/stream_core/lib/src/ws/client/web_socket_health_monitor.dart index 940eb7b8..f4299c32 100644 --- a/packages/stream_core/lib/src/ws/client/web_socket_health_monitor.dart +++ b/packages/stream_core/lib/src/ws/client/web_socket_health_monitor.dart @@ -41,10 +41,10 @@ abstract interface class WebSocketHealthListener { class WebSocketHealthMonitor { /// Creates a new instance of [WebSocketHealthMonitor]. WebSocketHealthMonitor({ - required WebSocketHealthListener listener, + required this._listener, this.pingInterval = const Duration(seconds: 25), this.timeoutThreshold = const Duration(seconds: 3), - }) : _listener = listener; + }); /// The interval between ping requests for health checking. final Duration pingInterval; diff --git a/packages/stream_core/pubspec.yaml b/packages/stream_core/pubspec.yaml index aaf62940..c28d1a61 100644 --- a/packages/stream_core/pubspec.yaml +++ b/packages/stream_core/pubspec.yaml @@ -16,7 +16,7 @@ repository: https://github.com/GetStream/stream-core-flutter # 2. Add it to the melos.yaml file for future updates. environment: - sdk: ^3.10.0 + sdk: ^3.12.0 dependencies: collection: ^1.19.0 diff --git a/packages/stream_core_flutter/CHANGELOG.md b/packages/stream_core_flutter/CHANGELOG.md index 88ef9c01..a5cd3c8a 100644 --- a/packages/stream_core_flutter/CHANGELOG.md +++ b/packages/stream_core_flutter/CHANGELOG.md @@ -1,3 +1,9 @@ +## Upcoming + +### 🔄 Changed + +- Raised the minimum Flutter version to `>=3.44.0` and the Dart SDK to `^3.12.0`. + ## 0.5.0 ### ✨ Features diff --git a/packages/stream_core_flutter/lib/src/components/common/stream_intrinsic_flex.dart b/packages/stream_core_flutter/lib/src/components/common/stream_intrinsic_flex.dart index 95f30402..1b9e9905 100644 --- a/packages/stream_core_flutter/lib/src/components/common/stream_intrinsic_flex.dart +++ b/packages/stream_core_flutter/lib/src/components/common/stream_intrinsic_flex.dart @@ -494,28 +494,20 @@ class _RenderStreamIntrinsicFlex extends RenderBox ContainerRenderObjectMixin, RenderBoxContainerDefaultsMixin { _RenderStreamIntrinsicFlex({ - required Axis direction, - required MainAxisAlignment mainAxisAlignment, - required MainAxisSize mainAxisSize, - required double spacing, + required this._direction, + required this._mainAxisAlignment, + required this._mainAxisSize, + required this._spacing, required CrossAxisAlignment crossAxisAlignment, - required TextBaseline? textBaseline, - required TextDirection? textDirection, - required VerticalDirection verticalDirection, - required Clip clipBehavior, + required this._textBaseline, + required this._textDirection, + required this._verticalDirection, + required this._clipBehavior, }) : assert( crossAxisAlignment != CrossAxisAlignment.stretch, 'StreamIntrinsicFlex does not support $crossAxisAlignment.', ), - _direction = direction, - _mainAxisAlignment = mainAxisAlignment, - _mainAxisSize = mainAxisSize, - _spacing = spacing, - _crossAxisAlignment = crossAxisAlignment, - _textBaseline = textBaseline, - _textDirection = textDirection, - _verticalDirection = verticalDirection, - _clipBehavior = clipBehavior; + _crossAxisAlignment = crossAxisAlignment; Axis get direction => _direction; Axis _direction; diff --git a/packages/stream_core_flutter/lib/src/components/common/stream_safe_area.dart b/packages/stream_core_flutter/lib/src/components/common/stream_safe_area.dart index 59ec42bf..b19b0485 100644 --- a/packages/stream_core_flutter/lib/src/components/common/stream_safe_area.dart +++ b/packages/stream_core_flutter/lib/src/components/common/stream_safe_area.dart @@ -73,8 +73,8 @@ class StreamSafeArea extends StatelessWidget { /// clamped to `[0, 1]`. const StreamSafeArea.driven({ super.key, - required ValueListenable listenable, - EdgeInsets to = EdgeInsets.zero, + required ValueListenable this._listenable, + this._to = EdgeInsets.zero, this.left = true, this.top = true, this.right = true, @@ -83,8 +83,7 @@ class StreamSafeArea extends StatelessWidget { this.margin = EdgeInsets.zero, this.maintainBottomViewPadding = false, required this.child, - }) : _listenable = listenable, - _to = to; + }); /// Whether to avoid system intrusions on the left ([minimum] and [margin] apply either way). final bool left; diff --git a/packages/stream_core_flutter/lib/src/components/common/stream_tap_target_padding.dart b/packages/stream_core_flutter/lib/src/components/common/stream_tap_target_padding.dart index 29d65790..993552d6 100644 --- a/packages/stream_core_flutter/lib/src/components/common/stream_tap_target_padding.dart +++ b/packages/stream_core_flutter/lib/src/components/common/stream_tap_target_padding.dart @@ -84,14 +84,11 @@ class StreamTapTargetPadding extends SingleChildRenderObjectWidget { class _RenderTapTargetPadding extends RenderShiftedBox { _RenderTapTargetPadding({ - required Size minSize, - required AlignmentGeometry alignment, - required TextDirection? textDirection, + required this._minSize, + required this._alignment, + required this._textDirection, RenderBox? child, - }) : _minSize = minSize, - _alignment = alignment, - _textDirection = textDirection, - super(child); + }) : super(child); Size get minSize => _minSize; Size _minSize; diff --git a/packages/stream_core_flutter/lib/src/components/sheet/stream_sheet.dart b/packages/stream_core_flutter/lib/src/components/sheet/stream_sheet.dart index c972d6bd..2bf2717f 100644 --- a/packages/stream_core_flutter/lib/src/components/sheet/stream_sheet.dart +++ b/packages/stream_core_flutter/lib/src/components/sheet/stream_sheet.dart @@ -656,9 +656,9 @@ class StreamSheetRoute extends PageRoute { super.requestFocus, required this.builder, this.backgroundColor, - Color? barrierColor, + this._barrierColor, this.barrierLabel, - String? barrierOnTapHint, + this._barrierOnTapHint, this.shape, this.borderRadius, this.constraints, @@ -672,8 +672,7 @@ class StreamSheetRoute extends PageRoute { this.onDragEnd, this.parentSheet, this.capturedThemes, - }) : _barrierColor = barrierColor, - _barrierOnTapHint = barrierOnTapHint; + }); /// Builds the primary contents of the sheet. The provided [ScrollController] /// should be attached to the topmost scrollable widget inside the sheet. diff --git a/packages/stream_core_flutter/lib/src/factory/stream_component_factory.dart b/packages/stream_core_flutter/lib/src/factory/stream_component_factory.dart index b332a687..6c215d19 100644 --- a/packages/stream_core_flutter/lib/src/factory/stream_component_factory.dart +++ b/packages/stream_core_flutter/lib/src/factory/stream_component_factory.dart @@ -668,8 +668,8 @@ class StreamComponentBuilders with _$StreamComponentBuilders { final class StreamComponentBuilderExtension { /// Creates a builder extension for a component with Props type [T]. const StreamComponentBuilderExtension({ - required StreamComponentBuilder builder, - }) : _builder = builder; + required this._builder, + }); // The internal builder function that creates the widget from the context and props. final StreamComponentBuilder _builder; diff --git a/packages/stream_core_flutter/pubspec.yaml b/packages/stream_core_flutter/pubspec.yaml index 7a0be962..968e8990 100644 --- a/packages/stream_core_flutter/pubspec.yaml +++ b/packages/stream_core_flutter/pubspec.yaml @@ -4,8 +4,8 @@ version: 0.5.0 homepage: https://github.com/GetStream/stream-core-flutter environment: - sdk: ^3.10.0 - flutter: ">=3.38.1" + sdk: ^3.12.0 + flutter: ">=3.44.0" dependencies: cached_network_image_ce: ^4.9.0 diff --git a/packages/stream_thumbnail/CHANGELOG.md b/packages/stream_thumbnail/CHANGELOG.md index 60732342..6f01f714 100644 --- a/packages/stream_thumbnail/CHANGELOG.md +++ b/packages/stream_thumbnail/CHANGELOG.md @@ -1,3 +1,9 @@ +## Upcoming + +### 🔄 Changed + +- Raised the minimum Flutter version to `>=3.44.0` and the Dart SDK to `^3.12.0`. + ## 0.1.0 * Initial release. diff --git a/packages/stream_thumbnail/example/pubspec.yaml b/packages/stream_thumbnail/example/pubspec.yaml index e0e6f9cf..8175fce8 100644 --- a/packages/stream_thumbnail/example/pubspec.yaml +++ b/packages/stream_thumbnail/example/pubspec.yaml @@ -4,8 +4,8 @@ publish_to: 'none' version: 1.0.0+1 environment: - sdk: ^3.10.0 - flutter: ">=3.38.1" + sdk: ^3.12.0 + flutter: ">=3.44.0" dependencies: flutter: diff --git a/packages/stream_thumbnail/pubspec.yaml b/packages/stream_thumbnail/pubspec.yaml index 2cd583de..b2183f9c 100644 --- a/packages/stream_thumbnail/pubspec.yaml +++ b/packages/stream_thumbnail/pubspec.yaml @@ -5,8 +5,8 @@ homepage: https://github.com/GetStream/stream-core-flutter repository: https://github.com/GetStream/stream-core-flutter environment: - sdk: ^3.10.0 - flutter: ">=3.38.1" + sdk: ^3.12.0 + flutter: ">=3.44.0" dependencies: cross_file: ^0.3.4+2 diff --git a/pubspec.lock b/pubspec.lock index 1843812b..00115924 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -458,4 +458,4 @@ packages: source: hosted version: "2.2.3" sdks: - dart: ">=3.10.0 <4.0.0" + dart: ">=3.12.0 <4.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index 6e9eabda..098769b0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: stream_core_flutter_workspace environment: - sdk: ^3.10.0 + sdk: ^3.12.0 dev_dependencies: code_builder: ^4.10.1 From efed26063cfb02a08295b829a3c9c82ee19983da Mon Sep 17 00:00:00 2001 From: Sahil Kumar Date: Mon, 17 Aug 2026 12:27:17 +0200 Subject: [PATCH 3/7] chore(ui)!: migrate to material_ui and cupertino_ui MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flutter split Material and Cupertino out of the framework into the flutter.dev-published `material_ui` / `cupertino_ui` packages, both v1.0.0 and published on 2026-08-12, the same day as Flutter 3.47 stable. Both require `flutter: >=3.44.0`, which is exactly the floor raised in the parent commit — that is what unblocks this, and why it is stacked. Rewrites all 195 import directives across 194 tracked files: `package:flutter/material.dart` -> `package:material_ui/material_ui.dart`. Every occurrence was verified to be a plain import first — no export directives, no `show`/`hide` clauses, and no `package:flutter/cupertino.dart` import anywhere in the repo. Reordering moved the directive relative to its neighbours, so `directives_ordering` was reapplied via `dart fix`. Nothing imports Cupertino directly: the only `Cupertino` references are a doc-comment link and a private class name in `StreamSwitch`. So `cupertino_ui` arrives transitively through `material_ui` and gets no direct pubspec entry, which would otherwise be an unused dependency. This is breaking for consumers. `material_ui` ships its own implementations and Flutter 3.47's `material.dart` does not re-export them, so the two `ThemeData`/`ThemeExtension`/`ColorScheme` are unrelated types. An app that puts `StreamTheme` into Flutter's `ThemeData.extensions` no longer compiles; it must import `material_ui` and use its `MaterialApp`, which is also what supplies the `MaterialLocalizations` the components read. Two prefixed bridges remain, each for a dependency that has not migrated and each carrying an `// ignore: migrate_design_widgets`: - `StreamMessageText` restates the theme for `MarkdownStyleSheet.fromTheme`, mapping exactly the fields that factory reads so the rendering is unchanged. - The gallery builds a separate Flutter theme for Widgetbook's own chrome, over the same colors as before. `migrate_design_widgets` is enabled to hold the line — without it a new file can silently reintroduce the split. It is only recognised by the 3.47 analyzer, but that is safe at the 3.44 floor: `undefined_lint` is reported against the options file itself, and nothing in CI analyses the repo root, where `all_lint_rules.yaml` lives. Enabled, it reports exactly the two bridges above and nothing else, which is the proof the migration is complete. Two test-only adjustments, both consequences of the split rather than of anything this repo does differently: - `find.byTooltip` is bound to Flutter's `Tooltip`, so the bottom-nav tooltip test now matches `material_ui`'s by predicate. - Alchemist scaffolds golden tests with Flutter's `MaterialApp`, whose `MaterialLocalizations` the migrated `StreamBottomNavBar` cannot read. Its golden wrappers now provide `material_ui`'s delegates. Verified: `dart analyze --fatal-infos` clean across all four packages, barrels and formatting pass, `melos run generate:all` produces no diff, and `stream_core_flutter` fails the same 42 macOS-vs-Linux goldens as before the migration — an identical set, 362 passed either way. No golden was regenerated and no `.png` is touched. Co-Authored-By: Claude Opus 5 (1M context) --- STYLE_GUIDE.md | 13 ++- all_lint_rules.yaml | 1 + apps/design_system_gallery/AGENTS.md | 2 +- .../lib/app/gallery_app.dart | 2 +- .../lib/app/gallery_shell.dart | 13 ++- apps/design_system_gallery/lib/app/home.dart | 2 +- .../accessories/stream_audio_waveform.dart | 2 +- .../components/accessories/stream_emoji.dart | 2 +- .../accessories/stream_file_type_icons.dart | 2 +- .../lib/components/avatar/stream_avatar.dart | 2 +- .../avatar/stream_avatar_group.dart | 2 +- .../avatar/stream_avatar_stack.dart | 2 +- .../components/badge/stream_badge_count.dart | 2 +- .../badge/stream_badge_notification.dart | 2 +- .../components/badge/stream_error_badge.dart | 2 +- .../badge/stream_image_source_badge.dart | 2 +- .../badge/stream_online_indicator.dart | 2 +- .../components/badge/stream_retry_badge.dart | 2 +- .../lib/components/buttons/button.dart | 2 +- .../buttons/stream_emoji_button.dart | 2 +- .../buttons/stream_jump_to_unread_button.dart | 2 +- .../components/common/stream_checkbox.dart | 2 +- .../lib/components/common/stream_flex.dart | 2 +- .../common/stream_intrinsic_flex.dart | 2 +- .../common/stream_loading_spinner.dart | 2 +- .../common/stream_network_image.dart | 2 +- .../common/stream_progress_bar.dart | 2 +- .../common/stream_skeleton_loading.dart | 2 +- .../common/stream_tap_target_padding.dart | 2 +- .../components/common/stream_text_input.dart | 2 +- .../context_menu/stream_context_menu.dart | 2 +- .../controls/playback_speed_toggle.dart | 2 +- .../controls/stream_command_chip.dart | 2 +- .../controls/stream_emoji_chip.dart | 2 +- .../controls/stream_emoji_chip_bar.dart | 2 +- .../controls/stream_remove_control.dart | 2 +- .../components/controls/stream_stepper.dart | 2 +- .../components/controls/stream_switch.dart | 2 +- .../controls/stream_video_play_indicator.dart | 2 +- .../emoji/stream_emoji_picker_sheet.dart | 2 +- .../media_viewer/stream_media_viewer.dart | 2 +- .../message/stream_message_annotation.dart | 2 +- .../message/stream_message_attachment.dart | 2 +- .../message/stream_message_bubble.dart | 2 +- .../message/stream_message_content.dart | 2 +- .../message/stream_message_metadata.dart | 2 +- .../message/stream_message_replies.dart | 2 +- .../message/stream_message_text.dart | 2 +- ...sage_composer_attachment_edit_message.dart | 2 +- ...sage_composer_attachment_link_preview.dart | 2 +- .../message_composer_attachment_media.dart | 2 +- .../message_composer_attachment_reply.dart | 2 +- ...ssage_composer_attachment_unsupported.dart | 2 +- .../message_composer_file_attachment.dart | 2 +- .../reaction/stream_reaction_picker.dart | 2 +- .../components/reaction/stream_reactions.dart | 2 +- .../components/scaffold/stream_scaffold.dart | 2 +- .../lib/components/sheet/stream_sheet.dart | 2 +- .../components/snackbar/stream_snackbar.dart | 2 +- .../components/tiles/stream_list_tile.dart | 2 +- .../components/toolbar/stream_app_bar.dart | 2 +- .../toolbar/stream_bottom_app_bar.dart | 2 +- .../toolbar/stream_bottom_nav_bar.dart | 2 +- .../toolbar/stream_sheet_header.dart | 2 +- .../toolbar/stream_toolbar_button.dart | 2 +- .../lib/config/theme_configuration.dart | 36 ++++++- .../lib/core/preview_wrapper.dart | 2 +- apps/design_system_gallery/lib/main.dart | 2 +- .../lib/primitives/colors.dart | 2 +- .../lib/primitives/icons.dart | 2 +- .../lib/primitives/radius.dart | 2 +- .../lib/primitives/spacing.dart | 2 +- .../lib/semantics/elevations.dart | 2 +- .../lib/semantics/typography.dart | 2 +- .../theme_studio/avatar_palette_section.dart | 2 +- .../theme_studio/color_picker_tile.dart | 2 +- .../lib/widgets/theme_studio/mode_button.dart | 2 +- .../widgets/theme_studio/section_card.dart | 2 +- .../theme_customization_panel.dart | 2 +- .../lib/widgets/toolbar/baselines_toggle.dart | 2 +- .../widgets/toolbar/debug_paint_toggle.dart | 2 +- .../lib/widgets/toolbar/device_selector.dart | 2 +- .../widgets/toolbar/platform_selector.dart | 2 +- .../toolbar/semantics_debugger_toggle.dart | 2 +- .../toolbar/text_direction_selector.dart | 2 +- .../widgets/toolbar/text_scale_selector.dart | 2 +- .../widgets/toolbar/theme_mode_toggle.dart | 2 +- .../lib/widgets/toolbar/toolbar.dart | 2 +- .../lib/widgets/toolbar/toolbar_button.dart | 2 +- .../widgets/toolbar/widget_select_toggle.dart | 2 +- apps/design_system_gallery/pubspec.yaml | 1 + melos.yaml | 1 + packages/stream_core_flutter/CHANGELOG.md | 8 ++ .../a11y/stream_accessibility_autofocus.dart | 2 +- .../src/a11y/stream_semantics_announcer.dart | 2 +- ...stream_semantics_transition_announcer.dart | 3 +- .../accessories/stream_audio_waveform.dart | 2 +- .../components/accessories/stream_emoji.dart | 2 +- .../src/components/avatar/stream_avatar.dart | 2 +- .../avatar/stream_avatar_group.dart | 2 +- .../avatar/stream_avatar_stack.dart | 2 +- .../components/badge/stream_badge_count.dart | 2 +- .../badge/stream_badge_notification.dart | 2 +- .../components/badge/stream_error_badge.dart | 2 +- .../badge/stream_image_source_badge.dart | 2 +- .../badge/stream_online_indicator.dart | 2 +- .../components/badge/stream_retry_badge.dart | 2 +- .../src/components/buttons/stream_button.dart | 2 +- .../buttons/stream_emoji_button.dart | 2 +- .../buttons/stream_jump_to_unread_button.dart | 2 +- .../components/common/stream_checkbox.dart | 2 +- .../common/stream_intrinsic_flex.dart | 2 +- .../common/stream_loading_spinner.dart | 2 +- .../common/stream_network_image.dart | 2 +- .../common/stream_progress_bar.dart | 2 +- .../components/common/stream_text_input.dart | 2 +- .../context_menu/stream_context_menu.dart | 2 +- .../stream_context_menu_action.dart | 2 +- .../controls/stream_command_chip.dart | 2 +- .../controls/stream_emoji_chip.dart | 2 +- .../controls/stream_emoji_chip_bar.dart | 2 +- .../stream_playback_speed_toggle.dart | 2 +- .../controls/stream_remove_control.dart | 2 +- .../components/controls/stream_stepper.dart | 2 +- .../components/controls/stream_switch.dart | 2 +- .../emoji/stream_emoji_picker_sheet.dart | 2 +- .../src/components/list/stream_list_tile.dart | 2 +- .../media_viewer/stream_media_viewer.dart | 2 +- .../message/stream_message_annotation.dart | 2 +- .../message/stream_message_attachment.dart | 2 +- .../message/stream_message_bubble.dart | 2 +- .../message/stream_message_metadata.dart | 2 +- .../message/stream_message_replies.dart | 2 +- .../message/stream_message_text.dart | 41 +++++++- .../stream_message_composer_attachment.dart | 2 +- ...sage_composer_edit_message_attachment.dart | 2 +- ...sage_composer_link_preview_attachment.dart | 2 +- ...eam_message_composer_reply_attachment.dart | 2 +- .../reaction/stream_reaction_picker.dart | 2 +- .../components/reaction/stream_reactions.dart | 2 +- .../components/scaffold/stream_scaffold.dart | 2 +- .../src/components/sheet/stream_sheet.dart | 2 +- .../components/snackbar/stream_snackbar.dart | 2 +- .../components/toolbar/stream_app_bar.dart | 2 +- .../toolbar/stream_bottom_app_bar.dart | 2 +- .../toolbar/stream_bottom_nav_bar.dart | 2 +- .../toolbar/stream_sheet_header.dart | 2 +- .../components/toolbar/stream_toolbar.dart | 2 +- .../theme/components/stream_button_theme.dart | 2 +- .../components/stream_command_chip_theme.dart | 2 +- .../components/stream_emoji_chip_theme.dart | 2 +- .../stream_message_bubble_theme.dart | 2 +- .../stream_playback_speed_toggle_theme.dart | 2 +- .../theme/semantics/stream_color_scheme.dart | 2 +- .../theme/semantics/stream_text_theme.dart | 2 +- .../lib/src/theme/stream_floating_fade.dart | 2 +- .../lib/src/theme/stream_theme.dart | 2 +- packages/stream_core_flutter/pubspec.yaml | 1 + .../stream_accessibility_autofocus_test.dart | 2 +- .../a11y/stream_semantics_announcer_test.dart | 2 +- .../stream_audio_waveform_golden_test.dart | 2 +- .../avatar/stream_avatar_golden_test.dart | 2 +- .../avatar/stream_avatar_group_test.dart | 2 +- .../avatar/stream_avatar_stack_test.dart | 2 +- .../components/avatar/stream_avatar_test.dart | 2 +- ...stream_badge_notification_golden_test.dart | 2 +- .../badge/stream_media_badge_golden_test.dart | 2 +- .../stream_media_badge_semantics_test.dart | 2 +- .../buttons/stream_button_golden_test.dart | 2 +- .../buttons/stream_button_test.dart | 2 +- .../common/stream_network_image_test.dart | 2 +- .../common/stream_safe_area_test.dart | 2 +- .../common/stream_text_input_test.dart | 2 +- .../stream_command_chip_golden_test.dart | 2 +- .../stream_remove_control_golden_test.dart | 2 +- .../controls/stream_remove_control_test.dart | 2 +- .../stream_stepper_semantics_test.dart | 2 +- .../stream_media_viewer_test.dart | 2 +- .../stream_message_presentation_test.dart | 2 +- .../file_attachment_semantics_test.dart | 2 +- .../media_attachment_semantics_test.dart | 2 +- ...r_attachment_link_preview_golden_test.dart | 2 +- ...composer_attachment_reply_golden_test.dart | 2 +- .../stream_message_layout_test.dart | 2 +- .../reaction/stream_reactions_test.dart | 2 +- .../scaffold/stream_scaffold_test.dart | 2 +- .../components/sheet/stream_sheet_test.dart | 2 +- .../snackbar/stream_snackbar_golden_test.dart | 2 +- .../snackbar/stream_snackbar_test.dart | 2 +- .../stream_app_bar_focus_isolation_test.dart | 2 +- .../toolbar/stream_app_bar_golden_test.dart | 2 +- .../toolbar/stream_app_bar_test.dart | 2 +- .../stream_bottom_app_bar_golden_test.dart | 2 +- .../toolbar/stream_bottom_app_bar_test.dart | 2 +- .../stream_bottom_nav_bar_golden_test.dart | 96 +++++++++++-------- .../toolbar/stream_bottom_nav_bar_test.dart | 9 +- .../toolbar/stream_sheet_header_test.dart | 2 +- .../toolbar/stream_toolbar_button_test.dart | 2 +- ...am_theme_color_generation_golden_test.dart | 2 +- .../stream_theme_color_generation_test.dart | 2 +- .../test/theme/stream_theme_test.dart | 2 +- .../stream_thumbnail/example/lib/main.dart | 2 +- .../stream_thumbnail/example/pubspec.yaml | 1 + 203 files changed, 363 insertions(+), 241 deletions(-) diff --git a/STYLE_GUIDE.md b/STYLE_GUIDE.md index 4efd5389..99447d92 100644 --- a/STYLE_GUIDE.md +++ b/STYLE_GUIDE.md @@ -65,6 +65,9 @@ document; the section link is provided. - Single quotes, **relative imports inside `lib/src/`** (`always_use_package_imports` is disabled here — a deliberate divergence from Flutter's style, favouring refactor-friendly relative paths inside the package). +- Material and Cupertino come from `package:material_ui/material_ui.dart` and + `package:cupertino_ui/cupertino_ui.dart`, never `package:flutter/material.dart` — + the two sets of types are unrelated. `migrate_design_widgets` enforces this. - Trailing commas preserved, `const` wherever possible, `final` for locals that aren't reassigned. - Prefer named parameters for booleans (`avoid_positional_boolean_parameters`). @@ -626,10 +629,18 @@ import '../../theme/components/stream_avatar_theme.dart'; import '../common/stream_network_image.dart'; // GOOD — package: for external and cross-package imports. -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core/stream_core.dart'; ``` +Flutter split Material and Cupertino out of the framework, so +`package:flutter/material.dart` and `package:material_ui/material_ui.dart` declare +*different* `ThemeData`, `ThemeExtension` and widget types that cannot be passed to +one another. Always import `material_ui`. The `migrate_design_widgets` lint fails the +build on the old URI; the only exceptions are the prefixed bridges that adapt a value +for a package which has not migrated yet, each carrying an +`// ignore: migrate_design_widgets`. + Do not use `package:stream_core_flutter/...` inside `lib/src/` — that path is reserved for consumers, and using it internally would round-trip through the public barrel (which the `check:barrels` rule also forbids). diff --git a/all_lint_rules.yaml b/all_lint_rules.yaml index 0fb9e4b5..10f194d8 100644 --- a/all_lint_rules.yaml +++ b/all_lint_rules.yaml @@ -92,6 +92,7 @@ linter: - literal_only_boolean_expressions - matching_super_parameters - missing_code_block_language_in_doc_comment + - migrate_design_widgets - missing_whitespace_between_adjacent_strings - no_adjacent_strings_in_list - no_default_cases diff --git a/apps/design_system_gallery/AGENTS.md b/apps/design_system_gallery/AGENTS.md index d36e5a62..4ecae479 100644 --- a/apps/design_system_gallery/AGENTS.md +++ b/apps/design_system_gallery/AGENTS.md @@ -222,7 +222,7 @@ When modifying `ThemeConfiguration`, ensure `buildMaterialTheme()` stays updated Create a new file in `lib/components/`: ```dart -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/stream_core_flutter.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/app/gallery_app.dart b/apps/design_system_gallery/lib/app/gallery_app.dart index 48a5c37a..c51ba0a2 100644 --- a/apps/design_system_gallery/lib/app/gallery_app.dart +++ b/apps/design_system_gallery/lib/app/gallery_app.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:provider/provider.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/app/gallery_shell.dart b/apps/design_system_gallery/lib/app/gallery_shell.dart index 42ce4758..ee9192e3 100644 --- a/apps/design_system_gallery/lib/app/gallery_shell.dart +++ b/apps/design_system_gallery/lib/app/gallery_shell.dart @@ -1,7 +1,9 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; +import 'package:provider/provider.dart'; import 'package:stream_core_flutter/core.dart'; import 'package:widgetbook/widgetbook.dart'; +import '../config/theme_configuration.dart'; import '../core/preview_wrapper.dart'; import '../widgets/theme_studio/theme_customization_panel.dart'; import '../widgets/toolbar/toolbar.dart'; @@ -30,8 +32,9 @@ class GalleryShell extends StatelessWidget { @override Widget build(BuildContext context) { - final materialTheme = Theme.of(context); - final isDark = materialTheme.brightness == .dark; + final themeConfig = context.watch(); + final widgetbookTheme = themeConfig.buildWidgetbookTheme(); + final isDark = themeConfig.brightness == .dark; final screenWidth = MediaQuery.sizeOf(context).width; // Use overlay on small screens, side-by-side on large screens @@ -39,8 +42,8 @@ class GalleryShell extends StatelessWidget { final useOverlay = widgetbookWidth < kWidgetbookDesktopBreakpoint; final widgetbook = Widgetbook.material( - lightTheme: materialTheme, - darkTheme: materialTheme, + lightTheme: widgetbookTheme, + darkTheme: widgetbookTheme, themeMode: isDark ? .dark : .light, directories: _collapseDirectories(directories), home: const GalleryHomePage(), diff --git a/apps/design_system_gallery/lib/app/home.dart b/apps/design_system_gallery/lib/app/home.dart index d8db90dd..152cf403 100644 --- a/apps/design_system_gallery/lib/app/home.dart +++ b/apps/design_system_gallery/lib/app/home.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; import '../core/stream_icons.dart'; diff --git a/apps/design_system_gallery/lib/components/accessories/stream_audio_waveform.dart b/apps/design_system_gallery/lib/components/accessories/stream_audio_waveform.dart index 0d080459..4e82cdef 100644 --- a/apps/design_system_gallery/lib/components/accessories/stream_audio_waveform.dart +++ b/apps/design_system_gallery/lib/components/accessories/stream_audio_waveform.dart @@ -1,6 +1,6 @@ import 'dart:math' as math; -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/components/accessories/stream_emoji.dart b/apps/design_system_gallery/lib/components/accessories/stream_emoji.dart index 77c23a27..2e65775d 100644 --- a/apps/design_system_gallery/lib/components/accessories/stream_emoji.dart +++ b/apps/design_system_gallery/lib/components/accessories/stream_emoji.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; import 'package:unicode_emojis/unicode_emojis.dart'; import 'package:widgetbook/widgetbook.dart'; diff --git a/apps/design_system_gallery/lib/components/accessories/stream_file_type_icons.dart b/apps/design_system_gallery/lib/components/accessories/stream_file_type_icons.dart index b1cc50a2..0f6101e9 100644 --- a/apps/design_system_gallery/lib/components/accessories/stream_file_type_icons.dart +++ b/apps/design_system_gallery/lib/components/accessories/stream_file_type_icons.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/components/avatar/stream_avatar.dart b/apps/design_system_gallery/lib/components/avatar/stream_avatar.dart index 520081ac..718b58a3 100644 --- a/apps/design_system_gallery/lib/components/avatar/stream_avatar.dart +++ b/apps/design_system_gallery/lib/components/avatar/stream_avatar.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/components/avatar/stream_avatar_group.dart b/apps/design_system_gallery/lib/components/avatar/stream_avatar_group.dart index de58637f..49bb37a3 100644 --- a/apps/design_system_gallery/lib/components/avatar/stream_avatar_group.dart +++ b/apps/design_system_gallery/lib/components/avatar/stream_avatar_group.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/components/avatar/stream_avatar_stack.dart b/apps/design_system_gallery/lib/components/avatar/stream_avatar_stack.dart index ad07bc3f..10d2ffd8 100644 --- a/apps/design_system_gallery/lib/components/avatar/stream_avatar_stack.dart +++ b/apps/design_system_gallery/lib/components/avatar/stream_avatar_stack.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/components/badge/stream_badge_count.dart b/apps/design_system_gallery/lib/components/badge/stream_badge_count.dart index 6260dadc..0210a87e 100644 --- a/apps/design_system_gallery/lib/components/badge/stream_badge_count.dart +++ b/apps/design_system_gallery/lib/components/badge/stream_badge_count.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/components/badge/stream_badge_notification.dart b/apps/design_system_gallery/lib/components/badge/stream_badge_notification.dart index 6eb2494d..cd96e399 100644 --- a/apps/design_system_gallery/lib/components/badge/stream_badge_notification.dart +++ b/apps/design_system_gallery/lib/components/badge/stream_badge_notification.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/components/badge/stream_error_badge.dart b/apps/design_system_gallery/lib/components/badge/stream_error_badge.dart index e4ea39fa..37618a01 100644 --- a/apps/design_system_gallery/lib/components/badge/stream_error_badge.dart +++ b/apps/design_system_gallery/lib/components/badge/stream_error_badge.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/components/badge/stream_image_source_badge.dart b/apps/design_system_gallery/lib/components/badge/stream_image_source_badge.dart index 5bab5584..058ed8ab 100644 --- a/apps/design_system_gallery/lib/components/badge/stream_image_source_badge.dart +++ b/apps/design_system_gallery/lib/components/badge/stream_image_source_badge.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/chat.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/components/badge/stream_online_indicator.dart b/apps/design_system_gallery/lib/components/badge/stream_online_indicator.dart index 95d16094..e038d4b0 100644 --- a/apps/design_system_gallery/lib/components/badge/stream_online_indicator.dart +++ b/apps/design_system_gallery/lib/components/badge/stream_online_indicator.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/components/badge/stream_retry_badge.dart b/apps/design_system_gallery/lib/components/badge/stream_retry_badge.dart index b34e1f22..faa473ca 100644 --- a/apps/design_system_gallery/lib/components/badge/stream_retry_badge.dart +++ b/apps/design_system_gallery/lib/components/badge/stream_retry_badge.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/components/buttons/button.dart b/apps/design_system_gallery/lib/components/buttons/button.dart index 37d5cc39..e23bf75a 100644 --- a/apps/design_system_gallery/lib/components/buttons/button.dart +++ b/apps/design_system_gallery/lib/components/buttons/button.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/components/buttons/stream_emoji_button.dart b/apps/design_system_gallery/lib/components/buttons/stream_emoji_button.dart index 3a8adf48..ac766452 100644 --- a/apps/design_system_gallery/lib/components/buttons/stream_emoji_button.dart +++ b/apps/design_system_gallery/lib/components/buttons/stream_emoji_button.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; import 'package:unicode_emojis/unicode_emojis.dart'; import 'package:widgetbook/widgetbook.dart'; diff --git a/apps/design_system_gallery/lib/components/buttons/stream_jump_to_unread_button.dart b/apps/design_system_gallery/lib/components/buttons/stream_jump_to_unread_button.dart index 20db0907..07ff7c81 100644 --- a/apps/design_system_gallery/lib/components/buttons/stream_jump_to_unread_button.dart +++ b/apps/design_system_gallery/lib/components/buttons/stream_jump_to_unread_button.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/chat.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/components/common/stream_checkbox.dart b/apps/design_system_gallery/lib/components/common/stream_checkbox.dart index f4d8f669..1586dbee 100644 --- a/apps/design_system_gallery/lib/components/common/stream_checkbox.dart +++ b/apps/design_system_gallery/lib/components/common/stream_checkbox.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/components/common/stream_flex.dart b/apps/design_system_gallery/lib/components/common/stream_flex.dart index e2ff9add..4c3c5f02 100644 --- a/apps/design_system_gallery/lib/components/common/stream_flex.dart +++ b/apps/design_system_gallery/lib/components/common/stream_flex.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/components/common/stream_intrinsic_flex.dart b/apps/design_system_gallery/lib/components/common/stream_intrinsic_flex.dart index 08f65bf3..b3b019e9 100644 --- a/apps/design_system_gallery/lib/components/common/stream_intrinsic_flex.dart +++ b/apps/design_system_gallery/lib/components/common/stream_intrinsic_flex.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/components/common/stream_loading_spinner.dart b/apps/design_system_gallery/lib/components/common/stream_loading_spinner.dart index f9574997..9a70692f 100644 --- a/apps/design_system_gallery/lib/components/common/stream_loading_spinner.dart +++ b/apps/design_system_gallery/lib/components/common/stream_loading_spinner.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/components/common/stream_network_image.dart b/apps/design_system_gallery/lib/components/common/stream_network_image.dart index 837bb511..699aee7d 100644 --- a/apps/design_system_gallery/lib/components/common/stream_network_image.dart +++ b/apps/design_system_gallery/lib/components/common/stream_network_image.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/components/common/stream_progress_bar.dart b/apps/design_system_gallery/lib/components/common/stream_progress_bar.dart index 55c16dec..341bab7a 100644 --- a/apps/design_system_gallery/lib/components/common/stream_progress_bar.dart +++ b/apps/design_system_gallery/lib/components/common/stream_progress_bar.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/components/common/stream_skeleton_loading.dart b/apps/design_system_gallery/lib/components/common/stream_skeleton_loading.dart index 0cdc647a..f54090ac 100644 --- a/apps/design_system_gallery/lib/components/common/stream_skeleton_loading.dart +++ b/apps/design_system_gallery/lib/components/common/stream_skeleton_loading.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/components/common/stream_tap_target_padding.dart b/apps/design_system_gallery/lib/components/common/stream_tap_target_padding.dart index 8b7b4819..2b12b095 100644 --- a/apps/design_system_gallery/lib/components/common/stream_tap_target_padding.dart +++ b/apps/design_system_gallery/lib/components/common/stream_tap_target_padding.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/components/common/stream_text_input.dart b/apps/design_system_gallery/lib/components/common/stream_text_input.dart index e6ec4e8b..8acbee8f 100644 --- a/apps/design_system_gallery/lib/components/common/stream_text_input.dart +++ b/apps/design_system_gallery/lib/components/common/stream_text_input.dart @@ -1,5 +1,5 @@ -import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/components/context_menu/stream_context_menu.dart b/apps/design_system_gallery/lib/components/context_menu/stream_context_menu.dart index b1cdc0e2..13c2e0f9 100644 --- a/apps/design_system_gallery/lib/components/context_menu/stream_context_menu.dart +++ b/apps/design_system_gallery/lib/components/context_menu/stream_context_menu.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/components/controls/playback_speed_toggle.dart b/apps/design_system_gallery/lib/components/controls/playback_speed_toggle.dart index 72639619..1ebf6c0a 100644 --- a/apps/design_system_gallery/lib/components/controls/playback_speed_toggle.dart +++ b/apps/design_system_gallery/lib/components/controls/playback_speed_toggle.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/components/controls/stream_command_chip.dart b/apps/design_system_gallery/lib/components/controls/stream_command_chip.dart index b90a53d1..1bf7b4b2 100644 --- a/apps/design_system_gallery/lib/components/controls/stream_command_chip.dart +++ b/apps/design_system_gallery/lib/components/controls/stream_command_chip.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/chat.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/components/controls/stream_emoji_chip.dart b/apps/design_system_gallery/lib/components/controls/stream_emoji_chip.dart index 2c4d1c58..d6088053 100644 --- a/apps/design_system_gallery/lib/components/controls/stream_emoji_chip.dart +++ b/apps/design_system_gallery/lib/components/controls/stream_emoji_chip.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; import 'package:unicode_emojis/unicode_emojis.dart'; import 'package:widgetbook/widgetbook.dart'; diff --git a/apps/design_system_gallery/lib/components/controls/stream_emoji_chip_bar.dart b/apps/design_system_gallery/lib/components/controls/stream_emoji_chip_bar.dart index a8a217d2..a6fab3d4 100644 --- a/apps/design_system_gallery/lib/components/controls/stream_emoji_chip_bar.dart +++ b/apps/design_system_gallery/lib/components/controls/stream_emoji_chip_bar.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/components/controls/stream_remove_control.dart b/apps/design_system_gallery/lib/components/controls/stream_remove_control.dart index b22fd288..338d5a6d 100644 --- a/apps/design_system_gallery/lib/components/controls/stream_remove_control.dart +++ b/apps/design_system_gallery/lib/components/controls/stream_remove_control.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/components/controls/stream_stepper.dart b/apps/design_system_gallery/lib/components/controls/stream_stepper.dart index 4c970402..a5bde621 100644 --- a/apps/design_system_gallery/lib/components/controls/stream_stepper.dart +++ b/apps/design_system_gallery/lib/components/controls/stream_stepper.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/components/controls/stream_switch.dart b/apps/design_system_gallery/lib/components/controls/stream_switch.dart index 72d81b3b..6fe92ea3 100644 --- a/apps/design_system_gallery/lib/components/controls/stream_switch.dart +++ b/apps/design_system_gallery/lib/components/controls/stream_switch.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/components/controls/stream_video_play_indicator.dart b/apps/design_system_gallery/lib/components/controls/stream_video_play_indicator.dart index 3544cb92..9e86ff07 100644 --- a/apps/design_system_gallery/lib/components/controls/stream_video_play_indicator.dart +++ b/apps/design_system_gallery/lib/components/controls/stream_video_play_indicator.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/components/emoji/stream_emoji_picker_sheet.dart b/apps/design_system_gallery/lib/components/emoji/stream_emoji_picker_sheet.dart index 259c74b0..c4b05b7b 100644 --- a/apps/design_system_gallery/lib/components/emoji/stream_emoji_picker_sheet.dart +++ b/apps/design_system_gallery/lib/components/emoji/stream_emoji_picker_sheet.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/components/media_viewer/stream_media_viewer.dart b/apps/design_system_gallery/lib/components/media_viewer/stream_media_viewer.dart index 4ffa06c6..4ad116f1 100644 --- a/apps/design_system_gallery/lib/components/media_viewer/stream_media_viewer.dart +++ b/apps/design_system_gallery/lib/components/media_viewer/stream_media_viewer.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/components/message/stream_message_annotation.dart b/apps/design_system_gallery/lib/components/message/stream_message_annotation.dart index ba1497cb..74c2fc20 100644 --- a/apps/design_system_gallery/lib/components/message/stream_message_annotation.dart +++ b/apps/design_system_gallery/lib/components/message/stream_message_annotation.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/chat.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/components/message/stream_message_attachment.dart b/apps/design_system_gallery/lib/components/message/stream_message_attachment.dart index 6ae51182..ad75ba28 100644 --- a/apps/design_system_gallery/lib/components/message/stream_message_attachment.dart +++ b/apps/design_system_gallery/lib/components/message/stream_message_attachment.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/chat.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/components/message/stream_message_bubble.dart b/apps/design_system_gallery/lib/components/message/stream_message_bubble.dart index 4075840d..4167ef6b 100644 --- a/apps/design_system_gallery/lib/components/message/stream_message_bubble.dart +++ b/apps/design_system_gallery/lib/components/message/stream_message_bubble.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/chat.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/components/message/stream_message_content.dart b/apps/design_system_gallery/lib/components/message/stream_message_content.dart index a1822704..9a73a608 100644 --- a/apps/design_system_gallery/lib/components/message/stream_message_content.dart +++ b/apps/design_system_gallery/lib/components/message/stream_message_content.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/chat.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/components/message/stream_message_metadata.dart b/apps/design_system_gallery/lib/components/message/stream_message_metadata.dart index 34c543a2..d00e31c4 100644 --- a/apps/design_system_gallery/lib/components/message/stream_message_metadata.dart +++ b/apps/design_system_gallery/lib/components/message/stream_message_metadata.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/chat.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/components/message/stream_message_replies.dart b/apps/design_system_gallery/lib/components/message/stream_message_replies.dart index b424cb57..6ebe030c 100644 --- a/apps/design_system_gallery/lib/components/message/stream_message_replies.dart +++ b/apps/design_system_gallery/lib/components/message/stream_message_replies.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/chat.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/components/message/stream_message_text.dart b/apps/design_system_gallery/lib/components/message/stream_message_text.dart index 353cde59..18a5e9ab 100644 --- a/apps/design_system_gallery/lib/components/message/stream_message_text.dart +++ b/apps/design_system_gallery/lib/components/message/stream_message_text.dart @@ -1,7 +1,7 @@ -import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_markdown_plus/flutter_markdown_plus.dart'; import 'package:markdown/markdown.dart' as md; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/chat.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/components/message_composer/message_composer_attachment_edit_message.dart b/apps/design_system_gallery/lib/components/message_composer/message_composer_attachment_edit_message.dart index 8aa84833..134b1d53 100644 --- a/apps/design_system_gallery/lib/components/message_composer/message_composer_attachment_edit_message.dart +++ b/apps/design_system_gallery/lib/components/message_composer/message_composer_attachment_edit_message.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/chat.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/components/message_composer/message_composer_attachment_link_preview.dart b/apps/design_system_gallery/lib/components/message_composer/message_composer_attachment_link_preview.dart index c6e46456..a3d786b0 100644 --- a/apps/design_system_gallery/lib/components/message_composer/message_composer_attachment_link_preview.dart +++ b/apps/design_system_gallery/lib/components/message_composer/message_composer_attachment_link_preview.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/chat.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/components/message_composer/message_composer_attachment_media.dart b/apps/design_system_gallery/lib/components/message_composer/message_composer_attachment_media.dart index 7538a8c5..e8d3999a 100644 --- a/apps/design_system_gallery/lib/components/message_composer/message_composer_attachment_media.dart +++ b/apps/design_system_gallery/lib/components/message_composer/message_composer_attachment_media.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/chat.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/components/message_composer/message_composer_attachment_reply.dart b/apps/design_system_gallery/lib/components/message_composer/message_composer_attachment_reply.dart index b155dc17..06474d6e 100644 --- a/apps/design_system_gallery/lib/components/message_composer/message_composer_attachment_reply.dart +++ b/apps/design_system_gallery/lib/components/message_composer/message_composer_attachment_reply.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/chat.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/components/message_composer/message_composer_attachment_unsupported.dart b/apps/design_system_gallery/lib/components/message_composer/message_composer_attachment_unsupported.dart index c1f1536d..13727ddb 100644 --- a/apps/design_system_gallery/lib/components/message_composer/message_composer_attachment_unsupported.dart +++ b/apps/design_system_gallery/lib/components/message_composer/message_composer_attachment_unsupported.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/chat.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/components/message_composer/message_composer_file_attachment.dart b/apps/design_system_gallery/lib/components/message_composer/message_composer_file_attachment.dart index bae2b600..24954b3f 100644 --- a/apps/design_system_gallery/lib/components/message_composer/message_composer_file_attachment.dart +++ b/apps/design_system_gallery/lib/components/message_composer/message_composer_file_attachment.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/chat.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/components/reaction/stream_reaction_picker.dart b/apps/design_system_gallery/lib/components/reaction/stream_reaction_picker.dart index 8f4cb9a2..8e01fd48 100644 --- a/apps/design_system_gallery/lib/components/reaction/stream_reaction_picker.dart +++ b/apps/design_system_gallery/lib/components/reaction/stream_reaction_picker.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/chat.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/components/reaction/stream_reactions.dart b/apps/design_system_gallery/lib/components/reaction/stream_reactions.dart index aba7a514..e2c2bfe2 100644 --- a/apps/design_system_gallery/lib/components/reaction/stream_reactions.dart +++ b/apps/design_system_gallery/lib/components/reaction/stream_reactions.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/chat.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/components/scaffold/stream_scaffold.dart b/apps/design_system_gallery/lib/components/scaffold/stream_scaffold.dart index 41baf704..0919d320 100644 --- a/apps/design_system_gallery/lib/components/scaffold/stream_scaffold.dart +++ b/apps/design_system_gallery/lib/components/scaffold/stream_scaffold.dart @@ -1,5 +1,5 @@ import 'package:flutter/gestures.dart' show DragStartBehavior; -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/components/sheet/stream_sheet.dart b/apps/design_system_gallery/lib/components/sheet/stream_sheet.dart index ff8bb519..37e0c0e9 100644 --- a/apps/design_system_gallery/lib/components/sheet/stream_sheet.dart +++ b/apps/design_system_gallery/lib/components/sheet/stream_sheet.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/components/snackbar/stream_snackbar.dart b/apps/design_system_gallery/lib/components/snackbar/stream_snackbar.dart index c806bb83..750ad827 100644 --- a/apps/design_system_gallery/lib/components/snackbar/stream_snackbar.dart +++ b/apps/design_system_gallery/lib/components/snackbar/stream_snackbar.dart @@ -1,6 +1,6 @@ import 'dart:async'; -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/components/tiles/stream_list_tile.dart b/apps/design_system_gallery/lib/components/tiles/stream_list_tile.dart index 1455f7c0..e4d6ad97 100644 --- a/apps/design_system_gallery/lib/components/tiles/stream_list_tile.dart +++ b/apps/design_system_gallery/lib/components/tiles/stream_list_tile.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/components/toolbar/stream_app_bar.dart b/apps/design_system_gallery/lib/components/toolbar/stream_app_bar.dart index 19fc8092..5b8ce8a7 100644 --- a/apps/design_system_gallery/lib/components/toolbar/stream_app_bar.dart +++ b/apps/design_system_gallery/lib/components/toolbar/stream_app_bar.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/components/toolbar/stream_bottom_app_bar.dart b/apps/design_system_gallery/lib/components/toolbar/stream_bottom_app_bar.dart index 4e6aa92a..09cfad94 100644 --- a/apps/design_system_gallery/lib/components/toolbar/stream_bottom_app_bar.dart +++ b/apps/design_system_gallery/lib/components/toolbar/stream_bottom_app_bar.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/components/toolbar/stream_bottom_nav_bar.dart b/apps/design_system_gallery/lib/components/toolbar/stream_bottom_nav_bar.dart index d8bea558..56d74b2d 100644 --- a/apps/design_system_gallery/lib/components/toolbar/stream_bottom_nav_bar.dart +++ b/apps/design_system_gallery/lib/components/toolbar/stream_bottom_nav_bar.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/components/toolbar/stream_sheet_header.dart b/apps/design_system_gallery/lib/components/toolbar/stream_sheet_header.dart index 6ef0eaf7..5ee9676a 100644 --- a/apps/design_system_gallery/lib/components/toolbar/stream_sheet_header.dart +++ b/apps/design_system_gallery/lib/components/toolbar/stream_sheet_header.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/components/toolbar/stream_toolbar_button.dart b/apps/design_system_gallery/lib/components/toolbar/stream_toolbar_button.dart index d815ddf1..86f0e679 100644 --- a/apps/design_system_gallery/lib/components/toolbar/stream_toolbar_button.dart +++ b/apps/design_system_gallery/lib/components/toolbar/stream_toolbar_button.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; import 'package:widgetbook/widgetbook.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; diff --git a/apps/design_system_gallery/lib/config/theme_configuration.dart b/apps/design_system_gallery/lib/config/theme_configuration.dart index 3e162514..bf383d1f 100644 --- a/apps/design_system_gallery/lib/config/theme_configuration.dart +++ b/apps/design_system_gallery/lib/config/theme_configuration.dart @@ -1,4 +1,6 @@ -import 'package:flutter/material.dart'; +// ignore: migrate_design_widgets +import 'package:flutter/material.dart' as flutter; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; /// A notifier that manages the theme configuration for the design system gallery. @@ -783,4 +785,36 @@ class ThemeConfiguration extends ChangeNotifier { ), ); } + + /// Builds the Flutter Material theme that styles Widgetbook's own chrome. + /// + /// Widgetbook still takes Flutter's `ThemeData`, which is an unrelated type + /// to `material_ui`'s, so the branding is restated here over the same + /// colors. Remove once Widgetbook migrates. + flutter.ThemeData buildWidgetbookTheme() { + final isDark = brightness == Brightness.dark; + + return flutter.ThemeData( + colorScheme: (isDark ? flutter.ColorScheme.dark : flutter.ColorScheme.light)( + primary: accentPrimary, + secondary: accentPrimary, + tertiary: accentNeutral, + error: accentError, + surface: backgroundSurface, + surfaceContainerHighest: backgroundSurfaceSubtle, + onPrimary: textOnAccent, + onSecondary: textOnAccent, + onSurface: textPrimary, + onSurfaceVariant: textSecondary, + onError: textOnAccent, + outline: borderDefault, + outlineVariant: borderSubtle, + ), + scaffoldBackgroundColor: backgroundApp, + cardColor: backgroundSurface, + dividerColor: borderSubtle, + disabledColor: textDisabled, + hintColor: textTertiary, + ); + } } diff --git a/apps/design_system_gallery/lib/core/preview_wrapper.dart b/apps/design_system_gallery/lib/core/preview_wrapper.dart index fc185736..2a56e508 100644 --- a/apps/design_system_gallery/lib/core/preview_wrapper.dart +++ b/apps/design_system_gallery/lib/core/preview_wrapper.dart @@ -1,5 +1,5 @@ import 'package:device_frame_plus/device_frame_plus.dart'; -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:provider/provider.dart'; import 'package:stream_core_flutter/core.dart'; diff --git a/apps/design_system_gallery/lib/main.dart b/apps/design_system_gallery/lib/main.dart index 72a4e899..6307e341 100644 --- a/apps/design_system_gallery/lib/main.dart +++ b/apps/design_system_gallery/lib/main.dart @@ -1,6 +1,6 @@ import 'package:flutter/foundation.dart'; -import 'package:flutter/material.dart'; import 'package:marionette_flutter/marionette_flutter.dart'; +import 'package:material_ui/material_ui.dart'; import 'app/gallery_app.dart'; diff --git a/apps/design_system_gallery/lib/primitives/colors.dart b/apps/design_system_gallery/lib/primitives/colors.dart index f2796fee..53cec9ca 100644 --- a/apps/design_system_gallery/lib/primitives/colors.dart +++ b/apps/design_system_gallery/lib/primitives/colors.dart @@ -1,5 +1,5 @@ -import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart'; diff --git a/apps/design_system_gallery/lib/primitives/icons.dart b/apps/design_system_gallery/lib/primitives/icons.dart index 825abcd3..4635b57a 100644 --- a/apps/design_system_gallery/lib/primitives/icons.dart +++ b/apps/design_system_gallery/lib/primitives/icons.dart @@ -1,5 +1,5 @@ -import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart'; diff --git a/apps/design_system_gallery/lib/primitives/radius.dart b/apps/design_system_gallery/lib/primitives/radius.dart index d564dd63..eb9c30ab 100644 --- a/apps/design_system_gallery/lib/primitives/radius.dart +++ b/apps/design_system_gallery/lib/primitives/radius.dart @@ -1,5 +1,5 @@ -import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart'; diff --git a/apps/design_system_gallery/lib/primitives/spacing.dart b/apps/design_system_gallery/lib/primitives/spacing.dart index 2ec089de..83750cb1 100644 --- a/apps/design_system_gallery/lib/primitives/spacing.dart +++ b/apps/design_system_gallery/lib/primitives/spacing.dart @@ -1,5 +1,5 @@ -import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart'; diff --git a/apps/design_system_gallery/lib/semantics/elevations.dart b/apps/design_system_gallery/lib/semantics/elevations.dart index 5b1a7b61..fe79ca0b 100644 --- a/apps/design_system_gallery/lib/semantics/elevations.dart +++ b/apps/design_system_gallery/lib/semantics/elevations.dart @@ -1,5 +1,5 @@ -import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart'; diff --git a/apps/design_system_gallery/lib/semantics/typography.dart b/apps/design_system_gallery/lib/semantics/typography.dart index 9cd039f8..17763eb1 100644 --- a/apps/design_system_gallery/lib/semantics/typography.dart +++ b/apps/design_system_gallery/lib/semantics/typography.dart @@ -1,5 +1,5 @@ -import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; import 'package:widgetbook_annotation/widgetbook_annotation.dart'; diff --git a/apps/design_system_gallery/lib/widgets/theme_studio/avatar_palette_section.dart b/apps/design_system_gallery/lib/widgets/theme_studio/avatar_palette_section.dart index e887b64b..ad1a44a8 100644 --- a/apps/design_system_gallery/lib/widgets/theme_studio/avatar_palette_section.dart +++ b/apps/design_system_gallery/lib/widgets/theme_studio/avatar_palette_section.dart @@ -1,5 +1,5 @@ -import 'package:flutter/material.dart'; import 'package:flutter_colorpicker/flutter_colorpicker.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; /// A tile for editing a single avatar color pair (background and foreground). diff --git a/apps/design_system_gallery/lib/widgets/theme_studio/color_picker_tile.dart b/apps/design_system_gallery/lib/widgets/theme_studio/color_picker_tile.dart index 711952be..ec3ad135 100644 --- a/apps/design_system_gallery/lib/widgets/theme_studio/color_picker_tile.dart +++ b/apps/design_system_gallery/lib/widgets/theme_studio/color_picker_tile.dart @@ -1,5 +1,5 @@ -import 'package:flutter/material.dart'; import 'package:flutter_colorpicker/flutter_colorpicker.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; /// A tile that displays a color and opens a color picker when tapped. diff --git a/apps/design_system_gallery/lib/widgets/theme_studio/mode_button.dart b/apps/design_system_gallery/lib/widgets/theme_studio/mode_button.dart index a8418cc6..c969d41a 100644 --- a/apps/design_system_gallery/lib/widgets/theme_studio/mode_button.dart +++ b/apps/design_system_gallery/lib/widgets/theme_studio/mode_button.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; /// A button for selecting light or dark mode in the theme studio. diff --git a/apps/design_system_gallery/lib/widgets/theme_studio/section_card.dart b/apps/design_system_gallery/lib/widgets/theme_studio/section_card.dart index a2c86d57..16792811 100644 --- a/apps/design_system_gallery/lib/widgets/theme_studio/section_card.dart +++ b/apps/design_system_gallery/lib/widgets/theme_studio/section_card.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; /// A card container for theme customization sections. diff --git a/apps/design_system_gallery/lib/widgets/theme_studio/theme_customization_panel.dart b/apps/design_system_gallery/lib/widgets/theme_studio/theme_customization_panel.dart index 3ce90aa8..83a1262a 100644 --- a/apps/design_system_gallery/lib/widgets/theme_studio/theme_customization_panel.dart +++ b/apps/design_system_gallery/lib/widgets/theme_studio/theme_customization_panel.dart @@ -1,6 +1,6 @@ import 'dart:math' show Random; -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:provider/provider.dart'; import 'package:stream_core_flutter/core.dart'; diff --git a/apps/design_system_gallery/lib/widgets/toolbar/baselines_toggle.dart b/apps/design_system_gallery/lib/widgets/toolbar/baselines_toggle.dart index d544abcc..5511659d 100644 --- a/apps/design_system_gallery/lib/widgets/toolbar/baselines_toggle.dart +++ b/apps/design_system_gallery/lib/widgets/toolbar/baselines_toggle.dart @@ -1,5 +1,5 @@ -import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; +import 'package:material_ui/material_ui.dart'; import 'toolbar_button.dart'; diff --git a/apps/design_system_gallery/lib/widgets/toolbar/debug_paint_toggle.dart b/apps/design_system_gallery/lib/widgets/toolbar/debug_paint_toggle.dart index e9157772..16fa4a74 100644 --- a/apps/design_system_gallery/lib/widgets/toolbar/debug_paint_toggle.dart +++ b/apps/design_system_gallery/lib/widgets/toolbar/debug_paint_toggle.dart @@ -1,5 +1,5 @@ -import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; +import 'package:material_ui/material_ui.dart'; import 'toolbar_button.dart'; diff --git a/apps/design_system_gallery/lib/widgets/toolbar/device_selector.dart b/apps/design_system_gallery/lib/widgets/toolbar/device_selector.dart index 626816bb..f246da57 100644 --- a/apps/design_system_gallery/lib/widgets/toolbar/device_selector.dart +++ b/apps/design_system_gallery/lib/widgets/toolbar/device_selector.dart @@ -1,5 +1,5 @@ import 'package:device_frame_plus/device_frame_plus.dart'; -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; /// A dropdown selector for choosing the preview device. diff --git a/apps/design_system_gallery/lib/widgets/toolbar/platform_selector.dart b/apps/design_system_gallery/lib/widgets/toolbar/platform_selector.dart index e76e21d9..b7ee8684 100644 --- a/apps/design_system_gallery/lib/widgets/toolbar/platform_selector.dart +++ b/apps/design_system_gallery/lib/widgets/toolbar/platform_selector.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; /// A dropdown selector for choosing the target platform override. diff --git a/apps/design_system_gallery/lib/widgets/toolbar/semantics_debugger_toggle.dart b/apps/design_system_gallery/lib/widgets/toolbar/semantics_debugger_toggle.dart index 99a7fb53..cd2bc45a 100644 --- a/apps/design_system_gallery/lib/widgets/toolbar/semantics_debugger_toggle.dart +++ b/apps/design_system_gallery/lib/widgets/toolbar/semantics_debugger_toggle.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:provider/provider.dart'; import '../../config/preview_configuration.dart'; diff --git a/apps/design_system_gallery/lib/widgets/toolbar/text_direction_selector.dart b/apps/design_system_gallery/lib/widgets/toolbar/text_direction_selector.dart index a3e0627b..522b6074 100644 --- a/apps/design_system_gallery/lib/widgets/toolbar/text_direction_selector.dart +++ b/apps/design_system_gallery/lib/widgets/toolbar/text_direction_selector.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; /// A dropdown selector for choosing the text direction (LTR/RTL). diff --git a/apps/design_system_gallery/lib/widgets/toolbar/text_scale_selector.dart b/apps/design_system_gallery/lib/widgets/toolbar/text_scale_selector.dart index b0bb6a06..031ad808 100644 --- a/apps/design_system_gallery/lib/widgets/toolbar/text_scale_selector.dart +++ b/apps/design_system_gallery/lib/widgets/toolbar/text_scale_selector.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; /// A dropdown selector for choosing the text scale factor. diff --git a/apps/design_system_gallery/lib/widgets/toolbar/theme_mode_toggle.dart b/apps/design_system_gallery/lib/widgets/toolbar/theme_mode_toggle.dart index d5b37cc8..dde3753c 100644 --- a/apps/design_system_gallery/lib/widgets/toolbar/theme_mode_toggle.dart +++ b/apps/design_system_gallery/lib/widgets/toolbar/theme_mode_toggle.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; /// A toggle button for switching between light and dark theme modes. diff --git a/apps/design_system_gallery/lib/widgets/toolbar/toolbar.dart b/apps/design_system_gallery/lib/widgets/toolbar/toolbar.dart index 6ecd5d93..369218ae 100644 --- a/apps/design_system_gallery/lib/widgets/toolbar/toolbar.dart +++ b/apps/design_system_gallery/lib/widgets/toolbar/toolbar.dart @@ -1,5 +1,5 @@ import 'package:flutter/foundation.dart'; -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:provider/provider.dart'; import 'package:stream_core_flutter/core.dart'; diff --git a/apps/design_system_gallery/lib/widgets/toolbar/toolbar_button.dart b/apps/design_system_gallery/lib/widgets/toolbar/toolbar_button.dart index 59c70f06..03a4ed85 100644 --- a/apps/design_system_gallery/lib/widgets/toolbar/toolbar_button.dart +++ b/apps/design_system_gallery/lib/widgets/toolbar/toolbar_button.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; /// A reusable toolbar button with icon and tooltip. diff --git a/apps/design_system_gallery/lib/widgets/toolbar/widget_select_toggle.dart b/apps/design_system_gallery/lib/widgets/toolbar/widget_select_toggle.dart index ffda5b52..89200747 100644 --- a/apps/design_system_gallery/lib/widgets/toolbar/widget_select_toggle.dart +++ b/apps/design_system_gallery/lib/widgets/toolbar/widget_select_toggle.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'toolbar_button.dart'; diff --git a/apps/design_system_gallery/pubspec.yaml b/apps/design_system_gallery/pubspec.yaml index d9af0fac..77893d83 100644 --- a/apps/design_system_gallery/pubspec.yaml +++ b/apps/design_system_gallery/pubspec.yaml @@ -15,6 +15,7 @@ dependencies: flutter_markdown_plus: ^1.0.7 marionette_flutter: ^0.3.0 markdown: ^7.3.0 + material_ui: ^1.0.0 provider: ^6.1.5+1 stream_core_flutter: ^0.5.0 svg_icon_widget: ^0.0.1+1 diff --git a/melos.yaml b/melos.yaml index adda26e6..7f8565ea 100644 --- a/melos.yaml +++ b/melos.yaml @@ -31,6 +31,7 @@ command: json_annotation: ^4.9.0 markdown: ^7.3.0 material_color_utilities: '>=0.11.0 <0.14.0' + material_ui: ^1.0.0 meta: ^1.15.0 mime: ^2.0.0 path: ^1.9.0 diff --git a/packages/stream_core_flutter/CHANGELOG.md b/packages/stream_core_flutter/CHANGELOG.md index a5cd3c8a..6f0e6773 100644 --- a/packages/stream_core_flutter/CHANGELOG.md +++ b/packages/stream_core_flutter/CHANGELOG.md @@ -1,5 +1,13 @@ ## Upcoming +### 🛑 Breaking / Removals + +- Migrated to the `material_ui` package. Every Material type this package exposes — + `StreamTheme` (a `ThemeExtension`), `ThemeData`, `ColorScheme`, widgets — now comes from + `package:material_ui/material_ui.dart` and is unrelated to the same-named type in + `package:flutter/material.dart`. Apps must import `material_ui` (and `cupertino_ui`) and use its + `MaterialApp`, which also supplies the `MaterialLocalizations` the components read. + ### 🔄 Changed - Raised the minimum Flutter version to `>=3.44.0` and the Dart SDK to `^3.12.0`. diff --git a/packages/stream_core_flutter/lib/src/a11y/stream_accessibility_autofocus.dart b/packages/stream_core_flutter/lib/src/a11y/stream_accessibility_autofocus.dart index b3cb871b..47337808 100644 --- a/packages/stream_core_flutter/lib/src/a11y/stream_accessibility_autofocus.dart +++ b/packages/stream_core_flutter/lib/src/a11y/stream_accessibility_autofocus.dart @@ -1,7 +1,7 @@ import 'dart:async'; -import 'package:flutter/material.dart'; import 'package:flutter/semantics.dart'; +import 'package:material_ui/material_ui.dart'; /// A behavior-only wrapper that requests screen-reader focus on [child] /// shortly after mount. diff --git a/packages/stream_core_flutter/lib/src/a11y/stream_semantics_announcer.dart b/packages/stream_core_flutter/lib/src/a11y/stream_semantics_announcer.dart index 178b29e2..21474000 100644 --- a/packages/stream_core_flutter/lib/src/a11y/stream_semantics_announcer.dart +++ b/packages/stream_core_flutter/lib/src/a11y/stream_semantics_announcer.dart @@ -2,8 +2,8 @@ import 'dart:async'; -import 'package:flutter/material.dart'; import 'package:flutter/semantics.dart'; +import 'package:material_ui/material_ui.dart'; /// Dispatches screen-reader announcements with platform-aware delivery. /// diff --git a/packages/stream_core_flutter/lib/src/a11y/stream_semantics_transition_announcer.dart b/packages/stream_core_flutter/lib/src/a11y/stream_semantics_transition_announcer.dart index 811ad231..561a1f5b 100644 --- a/packages/stream_core_flutter/lib/src/a11y/stream_semantics_transition_announcer.dart +++ b/packages/stream_core_flutter/lib/src/a11y/stream_semantics_transition_announcer.dart @@ -1,5 +1,6 @@ -import 'package:flutter/material.dart'; import 'package:flutter/semantics.dart'; +import 'package:material_ui/material_ui.dart'; + import 'stream_semantics_announcer.dart'; /// A behavior-only wrapper that announces transitions on [listenable] to the diff --git a/packages/stream_core_flutter/lib/src/components/accessories/stream_audio_waveform.dart b/packages/stream_core_flutter/lib/src/components/accessories/stream_audio_waveform.dart index 217efd97..d4b01b3b 100644 --- a/packages/stream_core_flutter/lib/src/components/accessories/stream_audio_waveform.dart +++ b/packages/stream_core_flutter/lib/src/components/accessories/stream_audio_waveform.dart @@ -2,7 +2,7 @@ import 'dart:math' as math; import 'dart:ui'; import 'package:collection/collection.dart'; -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import '../../theme/components/stream_audio_waveform_theme.dart'; import '../../theme/stream_theme_extensions.dart'; diff --git a/packages/stream_core_flutter/lib/src/components/accessories/stream_emoji.dart b/packages/stream_core_flutter/lib/src/components/accessories/stream_emoji.dart index f238dbc3..4c01bd32 100644 --- a/packages/stream_core_flutter/lib/src/components/accessories/stream_emoji.dart +++ b/packages/stream_core_flutter/lib/src/components/accessories/stream_emoji.dart @@ -1,5 +1,5 @@ import 'package:flutter/foundation.dart'; -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import '../../factory/stream_component_factory.dart'; import '../common/stream_network_image.dart'; diff --git a/packages/stream_core_flutter/lib/src/components/avatar/stream_avatar.dart b/packages/stream_core_flutter/lib/src/components/avatar/stream_avatar.dart index 3dde3f05..a0cff1ac 100644 --- a/packages/stream_core_flutter/lib/src/components/avatar/stream_avatar.dart +++ b/packages/stream_core_flutter/lib/src/components/avatar/stream_avatar.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import '../../factory/stream_component_factory.dart'; import '../../theme/components/stream_avatar_theme.dart'; diff --git a/packages/stream_core_flutter/lib/src/components/avatar/stream_avatar_group.dart b/packages/stream_core_flutter/lib/src/components/avatar/stream_avatar_group.dart index e8c48df4..66b26cc2 100644 --- a/packages/stream_core_flutter/lib/src/components/avatar/stream_avatar_group.dart +++ b/packages/stream_core_flutter/lib/src/components/avatar/stream_avatar_group.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import '../../factory/stream_component_factory.dart'; import '../../theme/components/stream_avatar_theme.dart'; diff --git a/packages/stream_core_flutter/lib/src/components/avatar/stream_avatar_stack.dart b/packages/stream_core_flutter/lib/src/components/avatar/stream_avatar_stack.dart index 654685f4..ad8dae25 100644 --- a/packages/stream_core_flutter/lib/src/components/avatar/stream_avatar_stack.dart +++ b/packages/stream_core_flutter/lib/src/components/avatar/stream_avatar_stack.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import '../../factory/stream_component_factory.dart'; import '../../theme/components/stream_avatar_theme.dart'; diff --git a/packages/stream_core_flutter/lib/src/components/badge/stream_badge_count.dart b/packages/stream_core_flutter/lib/src/components/badge/stream_badge_count.dart index 96516d13..0e5909d9 100644 --- a/packages/stream_core_flutter/lib/src/components/badge/stream_badge_count.dart +++ b/packages/stream_core_flutter/lib/src/components/badge/stream_badge_count.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import '../../factory/stream_component_factory.dart'; import '../../theme/components/stream_badge_count_theme.dart'; diff --git a/packages/stream_core_flutter/lib/src/components/badge/stream_badge_notification.dart b/packages/stream_core_flutter/lib/src/components/badge/stream_badge_notification.dart index c38b4eca..a8bb00d4 100644 --- a/packages/stream_core_flutter/lib/src/components/badge/stream_badge_notification.dart +++ b/packages/stream_core_flutter/lib/src/components/badge/stream_badge_notification.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import '../../factory/stream_component_factory.dart'; import '../../theme/components/stream_badge_notification_theme.dart'; diff --git a/packages/stream_core_flutter/lib/src/components/badge/stream_error_badge.dart b/packages/stream_core_flutter/lib/src/components/badge/stream_error_badge.dart index b3088fc9..2904502e 100644 --- a/packages/stream_core_flutter/lib/src/components/badge/stream_error_badge.dart +++ b/packages/stream_core_flutter/lib/src/components/badge/stream_error_badge.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import '../../factory/stream_component_factory.dart'; import '../../theme/primitives/stream_icons.dart'; diff --git a/packages/stream_core_flutter/lib/src/components/badge/stream_image_source_badge.dart b/packages/stream_core_flutter/lib/src/components/badge/stream_image_source_badge.dart index da83df14..587206d8 100644 --- a/packages/stream_core_flutter/lib/src/components/badge/stream_image_source_badge.dart +++ b/packages/stream_core_flutter/lib/src/components/badge/stream_image_source_badge.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:svg_icon_widget/svg_icon_widget.dart'; import '../../factory/stream_component_factory.dart'; diff --git a/packages/stream_core_flutter/lib/src/components/badge/stream_online_indicator.dart b/packages/stream_core_flutter/lib/src/components/badge/stream_online_indicator.dart index 09276bce..8766372c 100644 --- a/packages/stream_core_flutter/lib/src/components/badge/stream_online_indicator.dart +++ b/packages/stream_core_flutter/lib/src/components/badge/stream_online_indicator.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import '../../factory/stream_component_factory.dart'; import '../../theme/components/stream_online_indicator_theme.dart'; diff --git a/packages/stream_core_flutter/lib/src/components/badge/stream_retry_badge.dart b/packages/stream_core_flutter/lib/src/components/badge/stream_retry_badge.dart index 1c263b5e..0bcb8fcc 100644 --- a/packages/stream_core_flutter/lib/src/components/badge/stream_retry_badge.dart +++ b/packages/stream_core_flutter/lib/src/components/badge/stream_retry_badge.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import '../../factory/stream_component_factory.dart'; import '../../theme/primitives/stream_icons.dart'; diff --git a/packages/stream_core_flutter/lib/src/components/buttons/stream_button.dart b/packages/stream_core_flutter/lib/src/components/buttons/stream_button.dart index a5e2e110..fc4a9040 100644 --- a/packages/stream_core_flutter/lib/src/components/buttons/stream_button.dart +++ b/packages/stream_core_flutter/lib/src/components/buttons/stream_button.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import '../../factory/stream_component_factory.dart'; import '../../theme/components/stream_button_theme.dart'; diff --git a/packages/stream_core_flutter/lib/src/components/buttons/stream_emoji_button.dart b/packages/stream_core_flutter/lib/src/components/buttons/stream_emoji_button.dart index 036022a8..20461a2a 100644 --- a/packages/stream_core_flutter/lib/src/components/buttons/stream_emoji_button.dart +++ b/packages/stream_core_flutter/lib/src/components/buttons/stream_emoji_button.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import '../../factory/stream_component_factory.dart'; import '../../theme/components/stream_emoji_button_theme.dart'; diff --git a/packages/stream_core_flutter/lib/src/components/buttons/stream_jump_to_unread_button.dart b/packages/stream_core_flutter/lib/src/components/buttons/stream_jump_to_unread_button.dart index 88cdada7..8eb8c046 100644 --- a/packages/stream_core_flutter/lib/src/components/buttons/stream_jump_to_unread_button.dart +++ b/packages/stream_core_flutter/lib/src/components/buttons/stream_jump_to_unread_button.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import '../../factory/stream_component_factory.dart'; import '../../theme/components/stream_button_theme.dart'; diff --git a/packages/stream_core_flutter/lib/src/components/common/stream_checkbox.dart b/packages/stream_core_flutter/lib/src/components/common/stream_checkbox.dart index 1c1b0887..bfa9837c 100644 --- a/packages/stream_core_flutter/lib/src/components/common/stream_checkbox.dart +++ b/packages/stream_core_flutter/lib/src/components/common/stream_checkbox.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import '../../factory/stream_component_factory.dart'; import '../../theme/components/stream_checkbox_theme.dart'; diff --git a/packages/stream_core_flutter/lib/src/components/common/stream_intrinsic_flex.dart b/packages/stream_core_flutter/lib/src/components/common/stream_intrinsic_flex.dart index 1b9e9905..4a593ebb 100644 --- a/packages/stream_core_flutter/lib/src/components/common/stream_intrinsic_flex.dart +++ b/packages/stream_core_flutter/lib/src/components/common/stream_intrinsic_flex.dart @@ -1,8 +1,8 @@ import 'dart:math' as math; import 'package:flutter/foundation.dart'; -import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; +import 'package:material_ui/material_ui.dart'; /// A widget that displays its children in a one-dimensional array, /// shrink-wrapping its cross-axis to the widest (or tallest) child. diff --git a/packages/stream_core_flutter/lib/src/components/common/stream_loading_spinner.dart b/packages/stream_core_flutter/lib/src/components/common/stream_loading_spinner.dart index 74bb5785..0a025ebd 100644 --- a/packages/stream_core_flutter/lib/src/components/common/stream_loading_spinner.dart +++ b/packages/stream_core_flutter/lib/src/components/common/stream_loading_spinner.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import '../../factory/stream_component_factory.dart'; import '../../theme/stream_theme_extensions.dart'; diff --git a/packages/stream_core_flutter/lib/src/components/common/stream_network_image.dart b/packages/stream_core_flutter/lib/src/components/common/stream_network_image.dart index 1afb2400..4109ef10 100644 --- a/packages/stream_core_flutter/lib/src/components/common/stream_network_image.dart +++ b/packages/stream_core_flutter/lib/src/components/common/stream_network_image.dart @@ -1,5 +1,5 @@ import 'package:cached_network_image_ce/cached_network_image.dart'; -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import '../../cache/internal/stream_image_cache.dart'; import '../../factory/stream_component_factory.dart'; diff --git a/packages/stream_core_flutter/lib/src/components/common/stream_progress_bar.dart b/packages/stream_core_flutter/lib/src/components/common/stream_progress_bar.dart index 98565088..ec00e1b3 100644 --- a/packages/stream_core_flutter/lib/src/components/common/stream_progress_bar.dart +++ b/packages/stream_core_flutter/lib/src/components/common/stream_progress_bar.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import '../../factory/stream_component_factory.dart'; import '../../theme/components/stream_progress_bar_theme.dart'; diff --git a/packages/stream_core_flutter/lib/src/components/common/stream_text_input.dart b/packages/stream_core_flutter/lib/src/components/common/stream_text_input.dart index a1fe3601..2c26b53a 100644 --- a/packages/stream_core_flutter/lib/src/components/common/stream_text_input.dart +++ b/packages/stream_core_flutter/lib/src/components/common/stream_text_input.dart @@ -1,6 +1,6 @@ -import 'package:flutter/material.dart'; import 'package:flutter/semantics.dart'; import 'package:flutter/services.dart'; +import 'package:material_ui/material_ui.dart'; import '../../factory/stream_component_factory.dart'; import '../../theme/components/stream_text_input_theme.dart'; diff --git a/packages/stream_core_flutter/lib/src/components/context_menu/stream_context_menu.dart b/packages/stream_core_flutter/lib/src/components/context_menu/stream_context_menu.dart index 65f8e9b2..9965123b 100644 --- a/packages/stream_core_flutter/lib/src/components/context_menu/stream_context_menu.dart +++ b/packages/stream_core_flutter/lib/src/components/context_menu/stream_context_menu.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import '../../theme/components/stream_context_menu_theme.dart'; import '../../theme/primitives/stream_radius.dart'; diff --git a/packages/stream_core_flutter/lib/src/components/context_menu/stream_context_menu_action.dart b/packages/stream_core_flutter/lib/src/components/context_menu/stream_context_menu_action.dart index 0ca7d97f..15c029b5 100644 --- a/packages/stream_core_flutter/lib/src/components/context_menu/stream_context_menu_action.dart +++ b/packages/stream_core_flutter/lib/src/components/context_menu/stream_context_menu_action.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core/stream_core.dart'; import '../../factory/stream_component_factory.dart'; diff --git a/packages/stream_core_flutter/lib/src/components/controls/stream_command_chip.dart b/packages/stream_core_flutter/lib/src/components/controls/stream_command_chip.dart index 2b64413c..841e6238 100644 --- a/packages/stream_core_flutter/lib/src/components/controls/stream_command_chip.dart +++ b/packages/stream_core_flutter/lib/src/components/controls/stream_command_chip.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import '../../factory/stream_component_factory.dart'; import '../../theme/components/stream_command_chip_theme.dart'; diff --git a/packages/stream_core_flutter/lib/src/components/controls/stream_emoji_chip.dart b/packages/stream_core_flutter/lib/src/components/controls/stream_emoji_chip.dart index 8b2d4521..32ba6ff7 100644 --- a/packages/stream_core_flutter/lib/src/components/controls/stream_emoji_chip.dart +++ b/packages/stream_core_flutter/lib/src/components/controls/stream_emoji_chip.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import '../../factory/stream_component_factory.dart'; import '../../theme/components/stream_emoji_chip_theme.dart'; diff --git a/packages/stream_core_flutter/lib/src/components/controls/stream_emoji_chip_bar.dart b/packages/stream_core_flutter/lib/src/components/controls/stream_emoji_chip_bar.dart index 3d4a676e..80e2246e 100644 --- a/packages/stream_core_flutter/lib/src/components/controls/stream_emoji_chip_bar.dart +++ b/packages/stream_core_flutter/lib/src/components/controls/stream_emoji_chip_bar.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import '../../factory/stream_component_factory.dart'; import '../../theme/stream_theme_extensions.dart'; diff --git a/packages/stream_core_flutter/lib/src/components/controls/stream_playback_speed_toggle.dart b/packages/stream_core_flutter/lib/src/components/controls/stream_playback_speed_toggle.dart index 99c19824..2f578ff3 100644 --- a/packages/stream_core_flutter/lib/src/components/controls/stream_playback_speed_toggle.dart +++ b/packages/stream_core_flutter/lib/src/components/controls/stream_playback_speed_toggle.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import '../../factory/stream_component_factory.dart'; import '../../theme/components/stream_playback_speed_toggle_theme.dart'; diff --git a/packages/stream_core_flutter/lib/src/components/controls/stream_remove_control.dart b/packages/stream_core_flutter/lib/src/components/controls/stream_remove_control.dart index cd3c779e..9779469b 100644 --- a/packages/stream_core_flutter/lib/src/components/controls/stream_remove_control.dart +++ b/packages/stream_core_flutter/lib/src/components/controls/stream_remove_control.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import '../../theme/stream_theme_extensions.dart'; import '../common/stream_tap_target_padding.dart'; diff --git a/packages/stream_core_flutter/lib/src/components/controls/stream_stepper.dart b/packages/stream_core_flutter/lib/src/components/controls/stream_stepper.dart index b1b08d89..281cf595 100644 --- a/packages/stream_core_flutter/lib/src/components/controls/stream_stepper.dart +++ b/packages/stream_core_flutter/lib/src/components/controls/stream_stepper.dart @@ -1,6 +1,6 @@ import 'dart:math' as math; -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import '../../factory/stream_component_factory.dart'; import '../../theme/components/stream_button_theme.dart'; diff --git a/packages/stream_core_flutter/lib/src/components/controls/stream_switch.dart b/packages/stream_core_flutter/lib/src/components/controls/stream_switch.dart index 9b3e26ff..9609a47b 100644 --- a/packages/stream_core_flutter/lib/src/components/controls/stream_switch.dart +++ b/packages/stream_core_flutter/lib/src/components/controls/stream_switch.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import '../../factory/stream_component_factory.dart'; import '../../theme/components/stream_switch_theme.dart'; diff --git a/packages/stream_core_flutter/lib/src/components/emoji/stream_emoji_picker_sheet.dart b/packages/stream_core_flutter/lib/src/components/emoji/stream_emoji_picker_sheet.dart index b45d2236..5e53f6c6 100644 --- a/packages/stream_core_flutter/lib/src/components/emoji/stream_emoji_picker_sheet.dart +++ b/packages/stream_core_flutter/lib/src/components/emoji/stream_emoji_picker_sheet.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import '../../theme/components/stream_emoji_button_theme.dart'; import '../../theme/components/stream_sheet_theme.dart'; diff --git a/packages/stream_core_flutter/lib/src/components/list/stream_list_tile.dart b/packages/stream_core_flutter/lib/src/components/list/stream_list_tile.dart index 2053f89f..4c9a503a 100644 --- a/packages/stream_core_flutter/lib/src/components/list/stream_list_tile.dart +++ b/packages/stream_core_flutter/lib/src/components/list/stream_list_tile.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import '../../factory/stream_component_factory.dart'; import '../../theme/components/stream_list_tile_theme.dart'; diff --git a/packages/stream_core_flutter/lib/src/components/media_viewer/stream_media_viewer.dart b/packages/stream_core_flutter/lib/src/components/media_viewer/stream_media_viewer.dart index 6a02d83b..78ba0466 100644 --- a/packages/stream_core_flutter/lib/src/components/media_viewer/stream_media_viewer.dart +++ b/packages/stream_core_flutter/lib/src/components/media_viewer/stream_media_viewer.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import '../../factory/stream_component_factory.dart'; import '../../theme/components/stream_app_bar_theme.dart'; diff --git a/packages/stream_core_flutter/lib/src/components/message/stream_message_annotation.dart b/packages/stream_core_flutter/lib/src/components/message/stream_message_annotation.dart index a23a8773..69b87e19 100644 --- a/packages/stream_core_flutter/lib/src/components/message/stream_message_annotation.dart +++ b/packages/stream_core_flutter/lib/src/components/message/stream_message_annotation.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import '../../factory/stream_component_factory.dart'; import '../../theme/components/stream_message_annotation_theme.dart'; diff --git a/packages/stream_core_flutter/lib/src/components/message/stream_message_attachment.dart b/packages/stream_core_flutter/lib/src/components/message/stream_message_attachment.dart index c04d2e3d..f22e1f5d 100644 --- a/packages/stream_core_flutter/lib/src/components/message/stream_message_attachment.dart +++ b/packages/stream_core_flutter/lib/src/components/message/stream_message_attachment.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import '../../theme/components/stream_message_attachment_theme.dart'; import '../../theme/components/stream_message_item_theme.dart'; diff --git a/packages/stream_core_flutter/lib/src/components/message/stream_message_bubble.dart b/packages/stream_core_flutter/lib/src/components/message/stream_message_bubble.dart index f17653db..dc0981c0 100644 --- a/packages/stream_core_flutter/lib/src/components/message/stream_message_bubble.dart +++ b/packages/stream_core_flutter/lib/src/components/message/stream_message_bubble.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import '../../factory/stream_component_factory.dart'; import '../../theme/components/stream_message_bubble_theme.dart'; diff --git a/packages/stream_core_flutter/lib/src/components/message/stream_message_metadata.dart b/packages/stream_core_flutter/lib/src/components/message/stream_message_metadata.dart index 8705bc7d..562bddae 100644 --- a/packages/stream_core_flutter/lib/src/components/message/stream_message_metadata.dart +++ b/packages/stream_core_flutter/lib/src/components/message/stream_message_metadata.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import '../../factory/stream_component_factory.dart'; import '../../theme/components/stream_message_item_theme.dart'; diff --git a/packages/stream_core_flutter/lib/src/components/message/stream_message_replies.dart b/packages/stream_core_flutter/lib/src/components/message/stream_message_replies.dart index ea3fe662..6919f81f 100644 --- a/packages/stream_core_flutter/lib/src/components/message/stream_message_replies.dart +++ b/packages/stream_core_flutter/lib/src/components/message/stream_message_replies.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import '../../factory/stream_component_factory.dart'; import '../../theme/components/stream_message_item_theme.dart'; diff --git a/packages/stream_core_flutter/lib/src/components/message/stream_message_text.dart b/packages/stream_core_flutter/lib/src/components/message/stream_message_text.dart index c4911eaf..5b21bcc4 100644 --- a/packages/stream_core_flutter/lib/src/components/message/stream_message_text.dart +++ b/packages/stream_core_flutter/lib/src/components/message/stream_message_text.dart @@ -1,6 +1,8 @@ -import 'package:flutter/material.dart'; +// ignore: migrate_design_widgets +import 'package:flutter/material.dart' as flutter; import 'package:flutter_markdown_plus/flutter_markdown_plus.dart'; import 'package:markdown/markdown.dart' as md; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core/stream_core.dart'; import '../../factory/stream_component_factory.dart'; @@ -353,7 +355,7 @@ class DefaultStreamMessageText extends StatelessWidget { ); final markdownSheet = MarkdownStyleSheet.fromTheme( - streamThemeData, // Apply stream theme data + streamThemeData.asFlutterMaterialTheme(), // Apply stream theme data ).copyWith(p: effectiveTextStyle, a: effectiveLinkStyle).merge(props.styleSheet); // Prepend mention syntax so `[text](mention[-type]:id)` is intercepted @@ -607,3 +609,38 @@ class _StreamMessageTextDefaults extends StreamMessageTextStyle { return .all(.new(fontSize: StreamEmojiSize.lg.value, height: 1)); } } + +extension on ThemeData { + /// Restates this theme as a Flutter Material [flutter.ThemeData] carrying the + /// fields [MarkdownStyleSheet.fromTheme] reads. + /// + /// `flutter_markdown_plus` still takes Flutter's `ThemeData`, which is an + /// unrelated type to `material_ui`'s. Remove once it migrates. + flutter.ThemeData asFlutterMaterialTheme() { + return flutter.ThemeData( + colorScheme: flutter.ColorScheme( + brightness: colorScheme.brightness, + primary: colorScheme.primary, + onPrimary: colorScheme.onPrimary, + secondary: colorScheme.secondary, + onSecondary: colorScheme.onSecondary, + error: colorScheme.error, + onError: colorScheme.onError, + surface: colorScheme.surface, + onSurface: colorScheme.onSurface, + surfaceContainerHighest: colorScheme.surfaceContainerHighest, + ), + primaryColor: primaryColor, + cardColor: cardColor, + dividerColor: dividerColor, + cardTheme: flutter.CardThemeData(color: cardTheme.color), + textTheme: flutter.TextTheme( + bodyLarge: textTheme.bodyLarge, + bodyMedium: textTheme.bodyMedium, + headlineSmall: textTheme.headlineSmall, + titleLarge: textTheme.titleLarge, + titleMedium: textTheme.titleMedium, + ), + ); + } +} diff --git a/packages/stream_core_flutter/lib/src/components/message_composer/attachment/stream_message_composer_attachment.dart b/packages/stream_core_flutter/lib/src/components/message_composer/attachment/stream_message_composer_attachment.dart index b886711d..0f36736c 100644 --- a/packages/stream_core_flutter/lib/src/components/message_composer/attachment/stream_message_composer_attachment.dart +++ b/packages/stream_core_flutter/lib/src/components/message_composer/attachment/stream_message_composer_attachment.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import '../../../factory/stream_component_factory.dart'; import '../../../theme/components/stream_message_composer_attachment_theme.dart'; diff --git a/packages/stream_core_flutter/lib/src/components/message_composer/attachment/stream_message_composer_edit_message_attachment.dart b/packages/stream_core_flutter/lib/src/components/message_composer/attachment/stream_message_composer_edit_message_attachment.dart index 287f795a..90e3d79c 100644 --- a/packages/stream_core_flutter/lib/src/components/message_composer/attachment/stream_message_composer_edit_message_attachment.dart +++ b/packages/stream_core_flutter/lib/src/components/message_composer/attachment/stream_message_composer_edit_message_attachment.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import '../../../factory/stream_component_factory.dart'; import '../../../theme/components/stream_message_composer_attachment_theme.dart'; diff --git a/packages/stream_core_flutter/lib/src/components/message_composer/attachment/stream_message_composer_link_preview_attachment.dart b/packages/stream_core_flutter/lib/src/components/message_composer/attachment/stream_message_composer_link_preview_attachment.dart index 79afd0b7..077cc3d7 100644 --- a/packages/stream_core_flutter/lib/src/components/message_composer/attachment/stream_message_composer_link_preview_attachment.dart +++ b/packages/stream_core_flutter/lib/src/components/message_composer/attachment/stream_message_composer_link_preview_attachment.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import '../../../factory/stream_component_factory.dart'; import '../../../theme/components/stream_message_composer_attachment_theme.dart'; diff --git a/packages/stream_core_flutter/lib/src/components/message_composer/attachment/stream_message_composer_reply_attachment.dart b/packages/stream_core_flutter/lib/src/components/message_composer/attachment/stream_message_composer_reply_attachment.dart index 93f45662..84a9a0a2 100644 --- a/packages/stream_core_flutter/lib/src/components/message_composer/attachment/stream_message_composer_reply_attachment.dart +++ b/packages/stream_core_flutter/lib/src/components/message_composer/attachment/stream_message_composer_reply_attachment.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import '../../../factory/stream_component_factory.dart'; import '../../../theme/components/stream_message_composer_attachment_theme.dart'; diff --git a/packages/stream_core_flutter/lib/src/components/reaction/stream_reaction_picker.dart b/packages/stream_core_flutter/lib/src/components/reaction/stream_reaction_picker.dart index 59c8c48e..36988470 100644 --- a/packages/stream_core_flutter/lib/src/components/reaction/stream_reaction_picker.dart +++ b/packages/stream_core_flutter/lib/src/components/reaction/stream_reaction_picker.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import '../../factory/stream_component_factory.dart'; import '../../theme/components/stream_reaction_picker_theme.dart'; diff --git a/packages/stream_core_flutter/lib/src/components/reaction/stream_reactions.dart b/packages/stream_core_flutter/lib/src/components/reaction/stream_reactions.dart index 48cc4f4b..5298d189 100644 --- a/packages/stream_core_flutter/lib/src/components/reaction/stream_reactions.dart +++ b/packages/stream_core_flutter/lib/src/components/reaction/stream_reactions.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core/stream_core.dart'; import '../../factory/stream_component_factory.dart'; diff --git a/packages/stream_core_flutter/lib/src/components/scaffold/stream_scaffold.dart b/packages/stream_core_flutter/lib/src/components/scaffold/stream_scaffold.dart index 3db36e84..c69a10d3 100644 --- a/packages/stream_core_flutter/lib/src/components/scaffold/stream_scaffold.dart +++ b/packages/stream_core_flutter/lib/src/components/scaffold/stream_scaffold.dart @@ -1,7 +1,7 @@ import 'dart:math' as math; import 'package:flutter/gestures.dart' show DragStartBehavior; -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import '../../theme/components/stream_app_bar_theme.dart'; import '../../theme/semantics/stream_color_scheme.dart'; diff --git a/packages/stream_core_flutter/lib/src/components/sheet/stream_sheet.dart b/packages/stream_core_flutter/lib/src/components/sheet/stream_sheet.dart index 2bf2717f..f24cf24e 100644 --- a/packages/stream_core_flutter/lib/src/components/sheet/stream_sheet.dart +++ b/packages/stream_core_flutter/lib/src/components/sheet/stream_sheet.dart @@ -1,7 +1,7 @@ import 'dart:math' as math; import 'package:flutter/gestures.dart'; -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import '../../theme/components/stream_sheet_theme.dart'; import '../../theme/primitives/stream_colors.dart'; diff --git a/packages/stream_core_flutter/lib/src/components/snackbar/stream_snackbar.dart b/packages/stream_core_flutter/lib/src/components/snackbar/stream_snackbar.dart index 5052ca55..88d30fba 100644 --- a/packages/stream_core_flutter/lib/src/components/snackbar/stream_snackbar.dart +++ b/packages/stream_core_flutter/lib/src/components/snackbar/stream_snackbar.dart @@ -1,7 +1,7 @@ import 'dart:async'; import 'dart:collection'; -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import '../../factory/stream_component_factory.dart'; import '../../theme/components/stream_button_theme.dart'; diff --git a/packages/stream_core_flutter/lib/src/components/toolbar/stream_app_bar.dart b/packages/stream_core_flutter/lib/src/components/toolbar/stream_app_bar.dart index 9dfdda2a..685e473f 100644 --- a/packages/stream_core_flutter/lib/src/components/toolbar/stream_app_bar.dart +++ b/packages/stream_core_flutter/lib/src/components/toolbar/stream_app_bar.dart @@ -1,5 +1,5 @@ import 'package:flutter/foundation.dart'; -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import '../../factory/stream_component_factory.dart'; import '../../theme/components/stream_app_bar_theme.dart'; diff --git a/packages/stream_core_flutter/lib/src/components/toolbar/stream_bottom_app_bar.dart b/packages/stream_core_flutter/lib/src/components/toolbar/stream_bottom_app_bar.dart index 77458e60..ec26a587 100644 --- a/packages/stream_core_flutter/lib/src/components/toolbar/stream_bottom_app_bar.dart +++ b/packages/stream_core_flutter/lib/src/components/toolbar/stream_bottom_app_bar.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import '../../factory/stream_component_factory.dart'; import '../../theme/components/stream_bottom_app_bar_theme.dart'; diff --git a/packages/stream_core_flutter/lib/src/components/toolbar/stream_bottom_nav_bar.dart b/packages/stream_core_flutter/lib/src/components/toolbar/stream_bottom_nav_bar.dart index 44ce4140..ace383bc 100644 --- a/packages/stream_core_flutter/lib/src/components/toolbar/stream_bottom_nav_bar.dart +++ b/packages/stream_core_flutter/lib/src/components/toolbar/stream_bottom_nav_bar.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import '../../factory/stream_component_factory.dart'; import '../../theme/components/stream_badge_notification_theme.dart'; diff --git a/packages/stream_core_flutter/lib/src/components/toolbar/stream_sheet_header.dart b/packages/stream_core_flutter/lib/src/components/toolbar/stream_sheet_header.dart index a0d66c2b..b6b738f6 100644 --- a/packages/stream_core_flutter/lib/src/components/toolbar/stream_sheet_header.dart +++ b/packages/stream_core_flutter/lib/src/components/toolbar/stream_sheet_header.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import '../../factory/stream_component_factory.dart'; import '../../theme/components/stream_button_theme.dart'; diff --git a/packages/stream_core_flutter/lib/src/components/toolbar/stream_toolbar.dart b/packages/stream_core_flutter/lib/src/components/toolbar/stream_toolbar.dart index 9ba21cee..eb912c1b 100644 --- a/packages/stream_core_flutter/lib/src/components/toolbar/stream_toolbar.dart +++ b/packages/stream_core_flutter/lib/src/components/toolbar/stream_toolbar.dart @@ -1,6 +1,6 @@ import 'dart:math' as math; -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; /// Default height of [StreamAppBar], [StreamBottomAppBar], and /// [StreamSheetHeader] per the Stream design system. diff --git a/packages/stream_core_flutter/lib/src/theme/components/stream_button_theme.dart b/packages/stream_core_flutter/lib/src/theme/components/stream_button_theme.dart index fa6e4d7c..875e7807 100644 --- a/packages/stream_core_flutter/lib/src/theme/components/stream_button_theme.dart +++ b/packages/stream_core_flutter/lib/src/theme/components/stream_button_theme.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:theme_extensions_builder_annotation/theme_extensions_builder_annotation.dart'; import '../stream_theme.dart'; diff --git a/packages/stream_core_flutter/lib/src/theme/components/stream_command_chip_theme.dart b/packages/stream_core_flutter/lib/src/theme/components/stream_command_chip_theme.dart index 5e05c20b..c405f63d 100644 --- a/packages/stream_core_flutter/lib/src/theme/components/stream_command_chip_theme.dart +++ b/packages/stream_core_flutter/lib/src/theme/components/stream_command_chip_theme.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:theme_extensions_builder_annotation/theme_extensions_builder_annotation.dart'; import '../stream_theme.dart'; diff --git a/packages/stream_core_flutter/lib/src/theme/components/stream_emoji_chip_theme.dart b/packages/stream_core_flutter/lib/src/theme/components/stream_emoji_chip_theme.dart index a912c281..8a45f693 100644 --- a/packages/stream_core_flutter/lib/src/theme/components/stream_emoji_chip_theme.dart +++ b/packages/stream_core_flutter/lib/src/theme/components/stream_emoji_chip_theme.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:theme_extensions_builder_annotation/theme_extensions_builder_annotation.dart'; import '../stream_theme.dart'; diff --git a/packages/stream_core_flutter/lib/src/theme/components/stream_message_bubble_theme.dart b/packages/stream_core_flutter/lib/src/theme/components/stream_message_bubble_theme.dart index 3ed9e8cf..fb18cbb1 100644 --- a/packages/stream_core_flutter/lib/src/theme/components/stream_message_bubble_theme.dart +++ b/packages/stream_core_flutter/lib/src/theme/components/stream_message_bubble_theme.dart @@ -1,5 +1,5 @@ -import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core/stream_core.dart'; import 'package:theme_extensions_builder_annotation/theme_extensions_builder_annotation.dart'; diff --git a/packages/stream_core_flutter/lib/src/theme/components/stream_playback_speed_toggle_theme.dart b/packages/stream_core_flutter/lib/src/theme/components/stream_playback_speed_toggle_theme.dart index f13a902f..d638e173 100644 --- a/packages/stream_core_flutter/lib/src/theme/components/stream_playback_speed_toggle_theme.dart +++ b/packages/stream_core_flutter/lib/src/theme/components/stream_playback_speed_toggle_theme.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:theme_extensions_builder_annotation/theme_extensions_builder_annotation.dart'; import '../stream_theme.dart'; diff --git a/packages/stream_core_flutter/lib/src/theme/semantics/stream_color_scheme.dart b/packages/stream_core_flutter/lib/src/theme/semantics/stream_color_scheme.dart index 3f8ad7d3..d945a41d 100644 --- a/packages/stream_core_flutter/lib/src/theme/semantics/stream_color_scheme.dart +++ b/packages/stream_core_flutter/lib/src/theme/semantics/stream_color_scheme.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core/stream_core.dart' show Standard; import 'package:theme_extensions_builder_annotation/theme_extensions_builder_annotation.dart'; diff --git a/packages/stream_core_flutter/lib/src/theme/semantics/stream_text_theme.dart b/packages/stream_core_flutter/lib/src/theme/semantics/stream_text_theme.dart index 4a27553f..89fdca68 100644 --- a/packages/stream_core_flutter/lib/src/theme/semantics/stream_text_theme.dart +++ b/packages/stream_core_flutter/lib/src/theme/semantics/stream_text_theme.dart @@ -1,5 +1,5 @@ import 'package:flutter/foundation.dart'; -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:theme_extensions_builder_annotation/theme_extensions_builder_annotation.dart'; import '../primitives/stream_typography.dart'; diff --git a/packages/stream_core_flutter/lib/src/theme/stream_floating_fade.dart b/packages/stream_core_flutter/lib/src/theme/stream_floating_fade.dart index 07b4ff31..4a57eb3b 100644 --- a/packages/stream_core_flutter/lib/src/theme/stream_floating_fade.dart +++ b/packages/stream_core_flutter/lib/src/theme/stream_floating_fade.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; /// Builds a [LinearGradient] that fades from a solid [color] into transparent, /// suitable for floating app bars, bottom navigation bars, and composers. diff --git a/packages/stream_core_flutter/lib/src/theme/stream_theme.dart b/packages/stream_core_flutter/lib/src/theme/stream_theme.dart index 0371732d..5993ae8f 100644 --- a/packages/stream_core_flutter/lib/src/theme/stream_theme.dart +++ b/packages/stream_core_flutter/lib/src/theme/stream_theme.dart @@ -1,5 +1,5 @@ import 'package:flutter/foundation.dart'; -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:theme_extensions_builder_annotation/theme_extensions_builder_annotation.dart'; import 'components/stream_app_bar_theme.dart'; diff --git a/packages/stream_core_flutter/pubspec.yaml b/packages/stream_core_flutter/pubspec.yaml index 968e8990..32def6c5 100644 --- a/packages/stream_core_flutter/pubspec.yaml +++ b/packages/stream_core_flutter/pubspec.yaml @@ -16,6 +16,7 @@ dependencies: flutter_svg: ^2.2.3 markdown: ^7.3.0 material_color_utilities: ">=0.11.0 <0.14.0" + material_ui: ^1.0.0 path: ^1.9.0 path_provider: ^2.1.5 shimmer: ^3.0.0 diff --git a/packages/stream_core_flutter/test/a11y/stream_accessibility_autofocus_test.dart b/packages/stream_core_flutter/test/a11y/stream_accessibility_autofocus_test.dart index 6e24f2bc..534c4b87 100644 --- a/packages/stream_core_flutter/test/a11y/stream_accessibility_autofocus_test.dart +++ b/packages/stream_core_flutter/test/a11y/stream_accessibility_autofocus_test.dart @@ -1,6 +1,6 @@ -import 'package:flutter/material.dart'; import 'package:flutter/services.dart' show SystemChannels; import 'package:flutter_test/flutter_test.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; void main() { diff --git a/packages/stream_core_flutter/test/a11y/stream_semantics_announcer_test.dart b/packages/stream_core_flutter/test/a11y/stream_semantics_announcer_test.dart index 1cc39351..ecce5c1a 100644 --- a/packages/stream_core_flutter/test/a11y/stream_semantics_announcer_test.dart +++ b/packages/stream_core_flutter/test/a11y/stream_semantics_announcer_test.dart @@ -1,7 +1,7 @@ -import 'package:flutter/material.dart'; import 'package:flutter/semantics.dart'; import 'package:flutter/services.dart' show SystemChannels; import 'package:flutter_test/flutter_test.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; void main() { diff --git a/packages/stream_core_flutter/test/components/accessories/stream_audio_waveform_golden_test.dart b/packages/stream_core_flutter/test/components/accessories/stream_audio_waveform_golden_test.dart index a8ccc54b..0ea21df9 100644 --- a/packages/stream_core_flutter/test/components/accessories/stream_audio_waveform_golden_test.dart +++ b/packages/stream_core_flutter/test/components/accessories/stream_audio_waveform_golden_test.dart @@ -3,8 +3,8 @@ import 'dart:math' as math; import 'package:alchemist/alchemist.dart'; -import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; final List _sampleWaveform = List.generate( diff --git a/packages/stream_core_flutter/test/components/avatar/stream_avatar_golden_test.dart b/packages/stream_core_flutter/test/components/avatar/stream_avatar_golden_test.dart index 5c92c8b9..32348ded 100644 --- a/packages/stream_core_flutter/test/components/avatar/stream_avatar_golden_test.dart +++ b/packages/stream_core_flutter/test/components/avatar/stream_avatar_golden_test.dart @@ -1,6 +1,6 @@ import 'package:alchemist/alchemist.dart'; -import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; void main() { diff --git a/packages/stream_core_flutter/test/components/avatar/stream_avatar_group_test.dart b/packages/stream_core_flutter/test/components/avatar/stream_avatar_group_test.dart index 7b8166c5..2148ee38 100644 --- a/packages/stream_core_flutter/test/components/avatar/stream_avatar_group_test.dart +++ b/packages/stream_core_flutter/test/components/avatar/stream_avatar_group_test.dart @@ -1,5 +1,5 @@ -import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; Widget _withStreamTheme(Widget child) { diff --git a/packages/stream_core_flutter/test/components/avatar/stream_avatar_stack_test.dart b/packages/stream_core_flutter/test/components/avatar/stream_avatar_stack_test.dart index 6c54ed1a..2bba1085 100644 --- a/packages/stream_core_flutter/test/components/avatar/stream_avatar_stack_test.dart +++ b/packages/stream_core_flutter/test/components/avatar/stream_avatar_stack_test.dart @@ -1,5 +1,5 @@ -import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; Widget _withStreamTheme(Widget child) { diff --git a/packages/stream_core_flutter/test/components/avatar/stream_avatar_test.dart b/packages/stream_core_flutter/test/components/avatar/stream_avatar_test.dart index 644e7e66..d4695aca 100644 --- a/packages/stream_core_flutter/test/components/avatar/stream_avatar_test.dart +++ b/packages/stream_core_flutter/test/components/avatar/stream_avatar_test.dart @@ -1,5 +1,5 @@ -import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; Widget _withStreamTheme(Widget child) { diff --git a/packages/stream_core_flutter/test/components/badge/stream_badge_notification_golden_test.dart b/packages/stream_core_flutter/test/components/badge/stream_badge_notification_golden_test.dart index c1b04da3..26729dc5 100644 --- a/packages/stream_core_flutter/test/components/badge/stream_badge_notification_golden_test.dart +++ b/packages/stream_core_flutter/test/components/badge/stream_badge_notification_golden_test.dart @@ -1,6 +1,6 @@ import 'package:alchemist/alchemist.dart'; -import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; void main() { diff --git a/packages/stream_core_flutter/test/components/badge/stream_media_badge_golden_test.dart b/packages/stream_core_flutter/test/components/badge/stream_media_badge_golden_test.dart index 0478762b..b4f9a364 100644 --- a/packages/stream_core_flutter/test/components/badge/stream_media_badge_golden_test.dart +++ b/packages/stream_core_flutter/test/components/badge/stream_media_badge_golden_test.dart @@ -1,8 +1,8 @@ // ignore_for_file: avoid_redundant_argument_values import 'package:alchemist/alchemist.dart'; -import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; void main() { diff --git a/packages/stream_core_flutter/test/components/badge/stream_media_badge_semantics_test.dart b/packages/stream_core_flutter/test/components/badge/stream_media_badge_semantics_test.dart index 43027f28..fef8d3c3 100644 --- a/packages/stream_core_flutter/test/components/badge/stream_media_badge_semantics_test.dart +++ b/packages/stream_core_flutter/test/components/badge/stream_media_badge_semantics_test.dart @@ -1,5 +1,5 @@ -import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; Widget _withStreamTheme(Widget child) { diff --git a/packages/stream_core_flutter/test/components/buttons/stream_button_golden_test.dart b/packages/stream_core_flutter/test/components/buttons/stream_button_golden_test.dart index 8f888673..6b174e8c 100644 --- a/packages/stream_core_flutter/test/components/buttons/stream_button_golden_test.dart +++ b/packages/stream_core_flutter/test/components/buttons/stream_button_golden_test.dart @@ -1,8 +1,8 @@ // ignore_for_file: avoid_redundant_argument_values import 'package:alchemist/alchemist.dart'; -import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; void main() { diff --git a/packages/stream_core_flutter/test/components/buttons/stream_button_test.dart b/packages/stream_core_flutter/test/components/buttons/stream_button_test.dart index c50f6992..e30d0517 100644 --- a/packages/stream_core_flutter/test/components/buttons/stream_button_test.dart +++ b/packages/stream_core_flutter/test/components/buttons/stream_button_test.dart @@ -1,6 +1,6 @@ import 'package:flutter/gestures.dart'; -import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; Widget _withStreamTheme( diff --git a/packages/stream_core_flutter/test/components/common/stream_network_image_test.dart b/packages/stream_core_flutter/test/components/common/stream_network_image_test.dart index 1afe4edd..2a273a80 100644 --- a/packages/stream_core_flutter/test/components/common/stream_network_image_test.dart +++ b/packages/stream_core_flutter/test/components/common/stream_network_image_test.dart @@ -1,6 +1,6 @@ import 'package:cached_network_image_ce/cached_network_image.dart'; -import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; Widget _withStreamTheme(Widget child) { diff --git a/packages/stream_core_flutter/test/components/common/stream_safe_area_test.dart b/packages/stream_core_flutter/test/components/common/stream_safe_area_test.dart index 0315a0ac..a3eacbeb 100644 --- a/packages/stream_core_flutter/test/components/common/stream_safe_area_test.dart +++ b/packages/stream_core_flutter/test/components/common/stream_safe_area_test.dart @@ -1,6 +1,6 @@ import 'package:flutter/foundation.dart'; -import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; void main() { diff --git a/packages/stream_core_flutter/test/components/common/stream_text_input_test.dart b/packages/stream_core_flutter/test/components/common/stream_text_input_test.dart index c22c5dca..9936a61c 100644 --- a/packages/stream_core_flutter/test/components/common/stream_text_input_test.dart +++ b/packages/stream_core_flutter/test/components/common/stream_text_input_test.dart @@ -1,7 +1,7 @@ import 'dart:ui' show SemanticsAction, Tristate; -import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; Widget _withStreamTheme(Widget child) { diff --git a/packages/stream_core_flutter/test/components/controls/stream_command_chip_golden_test.dart b/packages/stream_core_flutter/test/components/controls/stream_command_chip_golden_test.dart index 36845527..85b75c95 100644 --- a/packages/stream_core_flutter/test/components/controls/stream_command_chip_golden_test.dart +++ b/packages/stream_core_flutter/test/components/controls/stream_command_chip_golden_test.dart @@ -1,6 +1,6 @@ import 'package:alchemist/alchemist.dart'; -import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/chat.dart'; void main() { diff --git a/packages/stream_core_flutter/test/components/controls/stream_remove_control_golden_test.dart b/packages/stream_core_flutter/test/components/controls/stream_remove_control_golden_test.dart index bba3b31b..1fa35a1f 100644 --- a/packages/stream_core_flutter/test/components/controls/stream_remove_control_golden_test.dart +++ b/packages/stream_core_flutter/test/components/controls/stream_remove_control_golden_test.dart @@ -1,6 +1,6 @@ import 'package:alchemist/alchemist.dart'; -import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; void main() { diff --git a/packages/stream_core_flutter/test/components/controls/stream_remove_control_test.dart b/packages/stream_core_flutter/test/components/controls/stream_remove_control_test.dart index db70968d..48c58001 100644 --- a/packages/stream_core_flutter/test/components/controls/stream_remove_control_test.dart +++ b/packages/stream_core_flutter/test/components/controls/stream_remove_control_test.dart @@ -1,5 +1,5 @@ -import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; void main() { diff --git a/packages/stream_core_flutter/test/components/controls/stream_stepper_semantics_test.dart b/packages/stream_core_flutter/test/components/controls/stream_stepper_semantics_test.dart index b265caef..60f0694e 100644 --- a/packages/stream_core_flutter/test/components/controls/stream_stepper_semantics_test.dart +++ b/packages/stream_core_flutter/test/components/controls/stream_stepper_semantics_test.dart @@ -1,6 +1,6 @@ -import 'package:flutter/material.dart'; import 'package:flutter/semantics.dart' show SemanticsAction; import 'package:flutter_test/flutter_test.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; void main() { diff --git a/packages/stream_core_flutter/test/components/media_viewer/stream_media_viewer_test.dart b/packages/stream_core_flutter/test/components/media_viewer/stream_media_viewer_test.dart index fe27e700..59f2917b 100644 --- a/packages/stream_core_flutter/test/components/media_viewer/stream_media_viewer_test.dart +++ b/packages/stream_core_flutter/test/components/media_viewer/stream_media_viewer_test.dart @@ -1,5 +1,5 @@ -import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; const _childKey = Key('media-child'); diff --git a/packages/stream_core_flutter/test/components/message/stream_message_presentation_test.dart b/packages/stream_core_flutter/test/components/message/stream_message_presentation_test.dart index 8aee79a8..f83da91c 100644 --- a/packages/stream_core_flutter/test/components/message/stream_message_presentation_test.dart +++ b/packages/stream_core_flutter/test/components/message/stream_message_presentation_test.dart @@ -1,5 +1,5 @@ -import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/chat.dart'; /// Verifies that the metadata, annotation and replies defaults switch their diff --git a/packages/stream_core_flutter/test/components/message_composer/attachment/file_attachment_semantics_test.dart b/packages/stream_core_flutter/test/components/message_composer/attachment/file_attachment_semantics_test.dart index d4737eff..51b451f6 100644 --- a/packages/stream_core_flutter/test/components/message_composer/attachment/file_attachment_semantics_test.dart +++ b/packages/stream_core_flutter/test/components/message_composer/attachment/file_attachment_semantics_test.dart @@ -1,5 +1,5 @@ -import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/chat.dart'; Widget _withStreamTheme(Widget child) { diff --git a/packages/stream_core_flutter/test/components/message_composer/attachment/media_attachment_semantics_test.dart b/packages/stream_core_flutter/test/components/message_composer/attachment/media_attachment_semantics_test.dart index c032f428..d8b0816a 100644 --- a/packages/stream_core_flutter/test/components/message_composer/attachment/media_attachment_semantics_test.dart +++ b/packages/stream_core_flutter/test/components/message_composer/attachment/media_attachment_semantics_test.dart @@ -1,5 +1,5 @@ -import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/chat.dart'; Widget _withStreamTheme(Widget child) { diff --git a/packages/stream_core_flutter/test/components/message_composer/message_composer_attachment_link_preview_golden_test.dart b/packages/stream_core_flutter/test/components/message_composer/message_composer_attachment_link_preview_golden_test.dart index 7bc6bd08..33296c42 100644 --- a/packages/stream_core_flutter/test/components/message_composer/message_composer_attachment_link_preview_golden_test.dart +++ b/packages/stream_core_flutter/test/components/message_composer/message_composer_attachment_link_preview_golden_test.dart @@ -3,8 +3,8 @@ import 'dart:typed_data'; import 'package:alchemist/alchemist.dart'; -import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/chat.dart'; void main() { diff --git a/packages/stream_core_flutter/test/components/message_composer/message_composer_attachment_reply_golden_test.dart b/packages/stream_core_flutter/test/components/message_composer/message_composer_attachment_reply_golden_test.dart index 97b49768..3e42f8f7 100644 --- a/packages/stream_core_flutter/test/components/message_composer/message_composer_attachment_reply_golden_test.dart +++ b/packages/stream_core_flutter/test/components/message_composer/message_composer_attachment_reply_golden_test.dart @@ -1,8 +1,8 @@ // ignore_for_file: avoid_redundant_argument_values import 'package:alchemist/alchemist.dart'; -import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/chat.dart'; void main() { diff --git a/packages/stream_core_flutter/test/components/message_layout/stream_message_layout_test.dart b/packages/stream_core_flutter/test/components/message_layout/stream_message_layout_test.dart index d8c934e2..25833ea8 100644 --- a/packages/stream_core_flutter/test/components/message_layout/stream_message_layout_test.dart +++ b/packages/stream_core_flutter/test/components/message_layout/stream_message_layout_test.dart @@ -1,5 +1,5 @@ -import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/chat.dart'; void main() { diff --git a/packages/stream_core_flutter/test/components/reaction/stream_reactions_test.dart b/packages/stream_core_flutter/test/components/reaction/stream_reactions_test.dart index 2a7694d9..d79cdd74 100644 --- a/packages/stream_core_flutter/test/components/reaction/stream_reactions_test.dart +++ b/packages/stream_core_flutter/test/components/reaction/stream_reactions_test.dart @@ -1,5 +1,5 @@ -import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/chat.dart'; void main() { diff --git a/packages/stream_core_flutter/test/components/scaffold/stream_scaffold_test.dart b/packages/stream_core_flutter/test/components/scaffold/stream_scaffold_test.dart index 269a064f..6524a2e2 100644 --- a/packages/stream_core_flutter/test/components/scaffold/stream_scaffold_test.dart +++ b/packages/stream_core_flutter/test/components/scaffold/stream_scaffold_test.dart @@ -1,6 +1,6 @@ import 'package:flutter/gestures.dart' show DragStartBehavior; -import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; Widget _withStreamTheme(Widget child, {StreamSurfaceStyle surfaceStyle = StreamSurfaceStyle.regular}) { diff --git a/packages/stream_core_flutter/test/components/sheet/stream_sheet_test.dart b/packages/stream_core_flutter/test/components/sheet/stream_sheet_test.dart index 52c0cdd2..8d1bb9f1 100644 --- a/packages/stream_core_flutter/test/components/sheet/stream_sheet_test.dart +++ b/packages/stream_core_flutter/test/components/sheet/stream_sheet_test.dart @@ -1,6 +1,6 @@ -import 'package:flutter/material.dart'; import 'package:flutter/semantics.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; Widget _withStreamTheme(Widget child, {TargetPlatform? platform}) { diff --git a/packages/stream_core_flutter/test/components/snackbar/stream_snackbar_golden_test.dart b/packages/stream_core_flutter/test/components/snackbar/stream_snackbar_golden_test.dart index 36e9030b..e0a6a571 100644 --- a/packages/stream_core_flutter/test/components/snackbar/stream_snackbar_golden_test.dart +++ b/packages/stream_core_flutter/test/components/snackbar/stream_snackbar_golden_test.dart @@ -1,6 +1,6 @@ import 'package:alchemist/alchemist.dart'; -import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; void main() { diff --git a/packages/stream_core_flutter/test/components/snackbar/stream_snackbar_test.dart b/packages/stream_core_flutter/test/components/snackbar/stream_snackbar_test.dart index 083d50dd..b990aff8 100644 --- a/packages/stream_core_flutter/test/components/snackbar/stream_snackbar_test.dart +++ b/packages/stream_core_flutter/test/components/snackbar/stream_snackbar_test.dart @@ -1,5 +1,5 @@ -import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; void main() { diff --git a/packages/stream_core_flutter/test/components/toolbar/stream_app_bar_focus_isolation_test.dart b/packages/stream_core_flutter/test/components/toolbar/stream_app_bar_focus_isolation_test.dart index 0a566983..b92a9f81 100644 --- a/packages/stream_core_flutter/test/components/toolbar/stream_app_bar_focus_isolation_test.dart +++ b/packages/stream_core_flutter/test/components/toolbar/stream_app_bar_focus_isolation_test.dart @@ -1,6 +1,6 @@ -import 'package:flutter/material.dart'; import 'package:flutter/semantics.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; // Each slot of [StreamAppBar] must produce its own focus stop. A raw diff --git a/packages/stream_core_flutter/test/components/toolbar/stream_app_bar_golden_test.dart b/packages/stream_core_flutter/test/components/toolbar/stream_app_bar_golden_test.dart index 6479826c..76dfef8a 100644 --- a/packages/stream_core_flutter/test/components/toolbar/stream_app_bar_golden_test.dart +++ b/packages/stream_core_flutter/test/components/toolbar/stream_app_bar_golden_test.dart @@ -1,6 +1,6 @@ import 'package:alchemist/alchemist.dart'; -import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; const _kBarWidth = 390.0; diff --git a/packages/stream_core_flutter/test/components/toolbar/stream_app_bar_test.dart b/packages/stream_core_flutter/test/components/toolbar/stream_app_bar_test.dart index 6f782354..f8c5d64f 100644 --- a/packages/stream_core_flutter/test/components/toolbar/stream_app_bar_test.dart +++ b/packages/stream_core_flutter/test/components/toolbar/stream_app_bar_test.dart @@ -1,6 +1,6 @@ import 'package:flutter/foundation.dart'; -import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; Widget _withStreamTheme(Widget child) { diff --git a/packages/stream_core_flutter/test/components/toolbar/stream_bottom_app_bar_golden_test.dart b/packages/stream_core_flutter/test/components/toolbar/stream_bottom_app_bar_golden_test.dart index 5c3191e6..fcd416c5 100644 --- a/packages/stream_core_flutter/test/components/toolbar/stream_bottom_app_bar_golden_test.dart +++ b/packages/stream_core_flutter/test/components/toolbar/stream_bottom_app_bar_golden_test.dart @@ -1,6 +1,6 @@ import 'package:alchemist/alchemist.dart'; -import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; const _kBarWidth = 390.0; diff --git a/packages/stream_core_flutter/test/components/toolbar/stream_bottom_app_bar_test.dart b/packages/stream_core_flutter/test/components/toolbar/stream_bottom_app_bar_test.dart index 6ad54595..ce94bd91 100644 --- a/packages/stream_core_flutter/test/components/toolbar/stream_bottom_app_bar_test.dart +++ b/packages/stream_core_flutter/test/components/toolbar/stream_bottom_app_bar_test.dart @@ -1,5 +1,5 @@ -import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; Widget _withStreamTheme(Widget child) { diff --git a/packages/stream_core_flutter/test/components/toolbar/stream_bottom_nav_bar_golden_test.dart b/packages/stream_core_flutter/test/components/toolbar/stream_bottom_nav_bar_golden_test.dart index 635f7bb6..0ec3b100 100644 --- a/packages/stream_core_flutter/test/components/toolbar/stream_bottom_nav_bar_golden_test.dart +++ b/packages/stream_core_flutter/test/components/toolbar/stream_bottom_nav_bar_golden_test.dart @@ -1,6 +1,6 @@ import 'package:alchemist/alchemist.dart'; -import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; const _kBarWidth = 390.0; @@ -86,15 +86,17 @@ Widget _buildNavBarInTheme( Brightness brightness = Brightness.light, }) { final streamTheme = StreamTheme(brightness: brightness); - return Theme( - data: ThemeData( - brightness: brightness, - extensions: [streamTheme], - ), - child: Builder( - builder: (context) => Material( - color: StreamTheme.of(context).colorScheme.backgroundApp, - child: SizedBox(width: _kBarWidth, child: navBar), + return _withMaterialLocalizations( + child: Theme( + data: ThemeData( + brightness: brightness, + extensions: [streamTheme], + ), + child: Builder( + builder: (context) => Material( + color: StreamTheme.of(context).colorScheme.backgroundApp, + child: SizedBox(width: _kBarWidth, child: navBar), + ), ), ), ); @@ -107,38 +109,54 @@ Widget _buildFloatingNavBarInTheme( Brightness brightness = Brightness.light, }) { final streamTheme = StreamTheme(brightness: brightness); - return Theme( - data: ThemeData( - brightness: brightness, - extensions: [streamTheme], - ), - child: Builder( - builder: (context) { - final colorScheme = StreamTheme.of(context).colorScheme; - return SizedBox( - width: _kBarWidth, - height: kStreamToolbarHeight * 3, - child: Stack( - children: [ - Positioned.fill( - child: DecoratedBox( - decoration: BoxDecoration( - gradient: LinearGradient( - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - colors: [ - colorScheme.backgroundApp, - colorScheme.accentPrimary.withAlpha(0x40), - ], + return _withMaterialLocalizations( + child: Theme( + data: ThemeData( + brightness: brightness, + extensions: [streamTheme], + ), + child: Builder( + builder: (context) { + final colorScheme = StreamTheme.of(context).colorScheme; + return SizedBox( + width: _kBarWidth, + height: kStreamToolbarHeight * 3, + child: Stack( + children: [ + Positioned.fill( + child: DecoratedBox( + decoration: BoxDecoration( + gradient: LinearGradient( + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + colors: [ + colorScheme.backgroundApp, + colorScheme.accentPrimary.withAlpha(0x40), + ], + ), ), ), ), - ), - Positioned(bottom: 0, left: 0, right: 0, child: navBar), - ], - ), - ); - }, + Positioned(bottom: 0, left: 0, right: 0, child: navBar), + ], + ), + ); + }, + ), ), ); } + +/// Alchemist scaffolds golden tests with Flutter's own `MaterialApp`, whose +/// `MaterialLocalizations` are an unrelated type to `material_ui`'s. Widgets +/// that read them find nothing without this. +Widget _withMaterialLocalizations({required Widget child}) { + return Localizations( + locale: const Locale('en', 'US'), + delegates: const [ + DefaultMaterialLocalizations.delegate, + DefaultWidgetsLocalizations.delegate, + ], + child: child, + ); +} diff --git a/packages/stream_core_flutter/test/components/toolbar/stream_bottom_nav_bar_test.dart b/packages/stream_core_flutter/test/components/toolbar/stream_bottom_nav_bar_test.dart index e80159b6..9920f3e9 100644 --- a/packages/stream_core_flutter/test/components/toolbar/stream_bottom_nav_bar_test.dart +++ b/packages/stream_core_flutter/test/components/toolbar/stream_bottom_nav_bar_test.dart @@ -1,5 +1,5 @@ -import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; const _items = [ @@ -100,7 +100,12 @@ void main() { ), ); - expect(find.byTooltip('Go home'), findsOneWidget); + // Not `find.byTooltip`: that finder is bound to Flutter's own `Tooltip`, + // an unrelated type to the `material_ui` one the bar builds. + expect( + find.byWidgetPredicate((widget) => widget is Tooltip && widget.message == 'Go home'), + findsOneWidget, + ); }); testWidgets('shows no tooltip for an empty tooltip string', (tester) async { diff --git a/packages/stream_core_flutter/test/components/toolbar/stream_sheet_header_test.dart b/packages/stream_core_flutter/test/components/toolbar/stream_sheet_header_test.dart index 5dc282fb..4465e9a6 100644 --- a/packages/stream_core_flutter/test/components/toolbar/stream_sheet_header_test.dart +++ b/packages/stream_core_flutter/test/components/toolbar/stream_sheet_header_test.dart @@ -1,8 +1,8 @@ import 'dart:async'; import 'package:flutter/foundation.dart'; -import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; Widget _withStreamTheme(Widget child) { diff --git a/packages/stream_core_flutter/test/components/toolbar/stream_toolbar_button_test.dart b/packages/stream_core_flutter/test/components/toolbar/stream_toolbar_button_test.dart index bab2c088..61cea8d8 100644 --- a/packages/stream_core_flutter/test/components/toolbar/stream_toolbar_button_test.dart +++ b/packages/stream_core_flutter/test/components/toolbar/stream_toolbar_button_test.dart @@ -1,5 +1,5 @@ -import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; Widget _withStreamTheme(Widget child, {StreamSurfaceStyle surfaceStyle = StreamSurfaceStyle.regular}) { diff --git a/packages/stream_core_flutter/test/theme/stream_theme_color_generation_golden_test.dart b/packages/stream_core_flutter/test/theme/stream_theme_color_generation_golden_test.dart index 393c64e4..bf44fba5 100644 --- a/packages/stream_core_flutter/test/theme/stream_theme_color_generation_golden_test.dart +++ b/packages/stream_core_flutter/test/theme/stream_theme_color_generation_golden_test.dart @@ -1,6 +1,6 @@ import 'package:alchemist/alchemist.dart'; -import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; /// The shades every generated [StreamColorSwatch] exposes (see diff --git a/packages/stream_core_flutter/test/theme/stream_theme_color_generation_test.dart b/packages/stream_core_flutter/test/theme/stream_theme_color_generation_test.dart index e9100e38..8b6c7191 100644 --- a/packages/stream_core_flutter/test/theme/stream_theme_color_generation_test.dart +++ b/packages/stream_core_flutter/test/theme/stream_theme_color_generation_test.dart @@ -1,6 +1,6 @@ -import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:material_color_utilities/material_color_utilities.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; /// Every shade a generated [StreamColorSwatch] exposes. diff --git a/packages/stream_core_flutter/test/theme/stream_theme_test.dart b/packages/stream_core_flutter/test/theme/stream_theme_test.dart index c4f8b557..5a9f93b8 100644 --- a/packages/stream_core_flutter/test/theme/stream_theme_test.dart +++ b/packages/stream_core_flutter/test/theme/stream_theme_test.dart @@ -1,5 +1,5 @@ -import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; void main() { diff --git a/packages/stream_thumbnail/example/lib/main.dart b/packages/stream_thumbnail/example/lib/main.dart index dae19066..0ffc1046 100644 --- a/packages/stream_thumbnail/example/lib/main.dart +++ b/packages/stream_thumbnail/example/lib/main.dart @@ -1,6 +1,6 @@ import 'dart:typed_data'; -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:stream_thumbnail/stream_thumbnail.dart'; void main() => runApp(const ExampleApp()); diff --git a/packages/stream_thumbnail/example/pubspec.yaml b/packages/stream_thumbnail/example/pubspec.yaml index 8175fce8..4b314085 100644 --- a/packages/stream_thumbnail/example/pubspec.yaml +++ b/packages/stream_thumbnail/example/pubspec.yaml @@ -10,6 +10,7 @@ environment: dependencies: flutter: sdk: flutter + material_ui: ^1.0.0 stream_thumbnail: ^0.1.0 dev_dependencies: From 8437607a96a0b1f7f1ec7df72495d0584e6d5615 Mon Sep 17 00:00:00 2001 From: Sahil Kumar Date: Mon, 17 Aug 2026 12:38:33 +0200 Subject: [PATCH 4/7] test(ui): provide material_ui localizations to the composer goldens MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CI caught two golden tests the local run could not: the composer's reply and link-preview matrices throw `No MaterialLocalizations found` for the same reason `StreamBottomNavBar` did — alchemist scaffolds golden tests with Flutter's own `MaterialApp`, whose localizations are an unrelated type to `material_ui`'s. The local check missed them because both files were already in the 42-golden macOS-vs-Linux baseline, so comparing failure *sets* showed no change while the underlying failure had switched from a pixel mismatch to a thrown exception rendering an error box. Comparing exception text rather than failure sets finds them: the run now reports zero `No MaterialLocalizations found`, and all 42 remaining failures are plain `Pixel test failed` with no widget-library exception among them. The wrapper introduced for the nav bar is extracted to `test/utils/material_localizations.dart` and shared by all three files, since any component reading localizations will need it. Co-Authored-By: Claude Opus 5 (1M context) --- ...r_attachment_link_preview_golden_test.dart | 26 +++++++++++-------- ...composer_attachment_reply_golden_test.dart | 26 +++++++++++-------- .../stream_bottom_nav_bar_golden_test.dart | 20 +++----------- .../test/utils/material_localizations.dart | 20 ++++++++++++++ 4 files changed, 54 insertions(+), 38 deletions(-) create mode 100644 packages/stream_core_flutter/test/utils/material_localizations.dart diff --git a/packages/stream_core_flutter/test/components/message_composer/message_composer_attachment_link_preview_golden_test.dart b/packages/stream_core_flutter/test/components/message_composer/message_composer_attachment_link_preview_golden_test.dart index 33296c42..bd550a4a 100644 --- a/packages/stream_core_flutter/test/components/message_composer/message_composer_attachment_link_preview_golden_test.dart +++ b/packages/stream_core_flutter/test/components/message_composer/message_composer_attachment_link_preview_golden_test.dart @@ -7,6 +7,8 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/chat.dart'; +import '../../utils/material_localizations.dart'; + void main() { group('MessageComposerAttachmentLinkPreview Golden Tests', () { goldenTest( @@ -211,17 +213,19 @@ Widget _buildLinkPreviewInTheme( Brightness brightness = Brightness.light, }) { final streamTheme = StreamTheme(brightness: brightness); - return Theme( - data: ThemeData( - brightness: brightness, - extensions: [streamTheme], - ), - child: Builder( - builder: (context) => Material( - color: StreamTheme.of(context).colorScheme.backgroundApp, - child: Padding( - padding: const EdgeInsets.all(8), - child: linkPreview, + return withMaterialLocalizations( + child: Theme( + data: ThemeData( + brightness: brightness, + extensions: [streamTheme], + ), + child: Builder( + builder: (context) => Material( + color: StreamTheme.of(context).colorScheme.backgroundApp, + child: Padding( + padding: const EdgeInsets.all(8), + child: linkPreview, + ), ), ), ), diff --git a/packages/stream_core_flutter/test/components/message_composer/message_composer_attachment_reply_golden_test.dart b/packages/stream_core_flutter/test/components/message_composer/message_composer_attachment_reply_golden_test.dart index 3e42f8f7..0bc1a68a 100644 --- a/packages/stream_core_flutter/test/components/message_composer/message_composer_attachment_reply_golden_test.dart +++ b/packages/stream_core_flutter/test/components/message_composer/message_composer_attachment_reply_golden_test.dart @@ -5,6 +5,8 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/chat.dart'; +import '../../utils/material_localizations.dart'; + void main() { group('MessageComposerAttachmentReply Golden Tests', () { goldenTest( @@ -84,17 +86,19 @@ Widget _buildReplyInTheme( Brightness brightness = Brightness.light, }) { final streamTheme = StreamTheme(brightness: brightness); - return Theme( - data: ThemeData( - brightness: brightness, - extensions: [streamTheme], - ), - child: Builder( - builder: (context) => Material( - color: StreamTheme.of(context).colorScheme.backgroundApp, - child: Padding( - padding: const EdgeInsets.all(8), - child: reply, + return withMaterialLocalizations( + child: Theme( + data: ThemeData( + brightness: brightness, + extensions: [streamTheme], + ), + child: Builder( + builder: (context) => Material( + color: StreamTheme.of(context).colorScheme.backgroundApp, + child: Padding( + padding: const EdgeInsets.all(8), + child: reply, + ), ), ), ), diff --git a/packages/stream_core_flutter/test/components/toolbar/stream_bottom_nav_bar_golden_test.dart b/packages/stream_core_flutter/test/components/toolbar/stream_bottom_nav_bar_golden_test.dart index 0ec3b100..f0798c19 100644 --- a/packages/stream_core_flutter/test/components/toolbar/stream_bottom_nav_bar_golden_test.dart +++ b/packages/stream_core_flutter/test/components/toolbar/stream_bottom_nav_bar_golden_test.dart @@ -3,6 +3,8 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; +import '../../utils/material_localizations.dart'; + const _kBarWidth = 390.0; const _items = [ @@ -86,7 +88,7 @@ Widget _buildNavBarInTheme( Brightness brightness = Brightness.light, }) { final streamTheme = StreamTheme(brightness: brightness); - return _withMaterialLocalizations( + return withMaterialLocalizations( child: Theme( data: ThemeData( brightness: brightness, @@ -109,7 +111,7 @@ Widget _buildFloatingNavBarInTheme( Brightness brightness = Brightness.light, }) { final streamTheme = StreamTheme(brightness: brightness); - return _withMaterialLocalizations( + return withMaterialLocalizations( child: Theme( data: ThemeData( brightness: brightness, @@ -146,17 +148,3 @@ Widget _buildFloatingNavBarInTheme( ), ); } - -/// Alchemist scaffolds golden tests with Flutter's own `MaterialApp`, whose -/// `MaterialLocalizations` are an unrelated type to `material_ui`'s. Widgets -/// that read them find nothing without this. -Widget _withMaterialLocalizations({required Widget child}) { - return Localizations( - locale: const Locale('en', 'US'), - delegates: const [ - DefaultMaterialLocalizations.delegate, - DefaultWidgetsLocalizations.delegate, - ], - child: child, - ); -} diff --git a/packages/stream_core_flutter/test/utils/material_localizations.dart b/packages/stream_core_flutter/test/utils/material_localizations.dart new file mode 100644 index 00000000..75582b3d --- /dev/null +++ b/packages/stream_core_flutter/test/utils/material_localizations.dart @@ -0,0 +1,20 @@ +import 'package:material_ui/material_ui.dart'; + +/// Provides `material_ui`'s [MaterialLocalizations] to [child]. +/// +/// Alchemist scaffolds golden tests with Flutter's own `MaterialApp`, whose +/// `MaterialLocalizations` are an unrelated type to `material_ui`'s. A +/// component that reads them — through a `Tooltip`, a semantics label, or +/// `MaterialLocalizations.of` directly — throws `No MaterialLocalizations +/// found` and renders an error box instead. Widget tests do not need this: +/// they wrap in `material_ui`'s `MaterialApp`, which supplies them. +Widget withMaterialLocalizations({required Widget child}) { + return Localizations( + locale: const Locale('en', 'US'), + delegates: const [ + DefaultMaterialLocalizations.delegate, + DefaultWidgetsLocalizations.delegate, + ], + child: child, + ); +} From 90837dfd7e19370c58e6f1ec7eb082b8697076cd Mon Sep 17 00:00:00 2001 From: Sahil Kumar Date: Mon, 17 Aug 2026 12:46:04 +0200 Subject: [PATCH 5/7] test(ui): cover the markdown theme bridge in StreamMessageText MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `StreamMessageText` had no tests, so the hand-written bridge that adapts `material_ui`'s `ThemeData` for `MarkdownStyleSheet.fromTheme` was the one piece of new logic in the migration with no coverage at all — codecov reported 0% of the diff hit. Pins the fields the bridge has to carry: the heading and body text styles, inline code's 85%-of-body sizing, `cardColor`, `dividerColor`, and that an explicitly supplied style sheet still wins. Dropping any of them from the bridge silently falls back to a Material default rather than failing, which is exactly the kind of regression a golden diff on one component would not localise. Not asserted: `blockquoteDecoration`, which the pinned flutter_markdown_plus 1.0.7 hardcodes to `Colors.blue.shade100` and only derives from `colorScheme.surfaceContainerHighest` in 1.0.12. The bridge maps the colour scheme anyway, so a dependency bump stays correct. Co-Authored-By: Claude Opus 5 (1M context) --- .../message/stream_message_text_test.dart | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 packages/stream_core_flutter/test/components/message/stream_message_text_test.dart diff --git a/packages/stream_core_flutter/test/components/message/stream_message_text_test.dart b/packages/stream_core_flutter/test/components/message/stream_message_text_test.dart new file mode 100644 index 00000000..8d36ea33 --- /dev/null +++ b/packages/stream_core_flutter/test/components/message/stream_message_text_test.dart @@ -0,0 +1,88 @@ +import 'package:flutter_markdown_plus/flutter_markdown_plus.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:material_ui/material_ui.dart'; +import 'package:stream_core_flutter/chat.dart'; + +MarkdownStyleSheet _pumpAndReadSheet(WidgetTester tester) { + return tester.widget(find.byType(MarkdownBody)).styleSheet!; +} + +Widget _withTheme(Widget child, {ThemeData? theme}) { + return MaterialApp( + theme: (theme ?? ThemeData()).copyWith(extensions: [StreamTheme()]), + home: Scaffold(body: child), + ); +} + +void main() { + group('StreamMessageText markdown style sheet', () { + // `MarkdownStyleSheet.fromTheme` takes Flutter's own `ThemeData`, which is + // an unrelated type to `material_ui`'s, so the widget bridges between them + // by hand. These assertions pin the fields that bridge has to carry — + // dropping one would silently fall back to a Material default. + testWidgets('derives heading styles from the ambient text theme', (tester) async { + const headline = TextStyle(fontSize: 33, fontWeight: FontWeight.w900); + const title = TextStyle(fontSize: 27); + + await tester.pumpWidget( + _withTheme( + StreamMessageText('# Heading\n\nBody text'), + theme: ThemeData( + textTheme: const TextTheme(headlineSmall: headline, titleLarge: title), + ), + ), + ); + + final sheet = _pumpAndReadSheet(tester); + expect(sheet.h1?.fontSize, headline.fontSize); + expect(sheet.h1?.fontWeight, headline.fontWeight); + expect(sheet.h2?.fontSize, title.fontSize); + }); + + testWidgets('sizes inline code relative to the body style', (tester) async { + const body = TextStyle(fontSize: 20); + + await tester.pumpWidget( + _withTheme( + StreamMessageText('Body with `code`'), + theme: ThemeData(textTheme: const TextTheme(bodyMedium: body)), + ), + ); + + // `fromTheme` derives code from bodyMedium at 85% of its size, so a + // bridge that dropped `textTheme` would land on Material's default 14. + expect(_pumpAndReadSheet(tester).code?.fontSize, body.fontSize! * 0.85); + }); + + testWidgets('takes the code block and table colors from the ambient theme', (tester) async { + const cardColor = Color(0xFFABCDEF); + const dividerColor = Color(0xFF123456); + + await tester.pumpWidget( + _withTheme( + StreamMessageText(' code block'), + theme: ThemeData(cardColor: cardColor, dividerColor: dividerColor), + ), + ); + + final sheet = _pumpAndReadSheet(tester); + expect((sheet.codeblockDecoration! as BoxDecoration).color, cardColor); + expect(sheet.tableBorder?.top.color, dividerColor); + }); + + testWidgets('lets an explicit style sheet win over the derived one', (tester) async { + const override = TextStyle(fontSize: 42); + + await tester.pumpWidget( + _withTheme( + StreamMessageText('# Heading', styleSheet: MarkdownStyleSheet(h1: override)), + theme: ThemeData( + textTheme: const TextTheme(headlineSmall: TextStyle(fontSize: 10)), + ), + ), + ); + + expect(_pumpAndReadSheet(tester).h1?.fontSize, override.fontSize); + }); + }); +} From 51c0ec6c7963489436a039dbf6092ea479cc1f95 Mon Sep 17 00:00:00 2001 From: Sahil Kumar Date: Mon, 17 Aug 2026 12:53:48 +0200 Subject: [PATCH 6/7] docs(repo): point the material_ui workarounds at their tracking issues MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Each place the migration left something behind now names the upstream package it is waiting on, so none of them survives on inertia after the dependency catches up. Two are bridges with a clear deletion trigger — the markdown theme adapter (FLU-701, flutter_markdown_plus) and the gallery's Widgetbook theme (FLU-703). One is a test helper every future component reading localizations will need until alchemist migrates (FLU-702). The other two are not workarounds but silent degradation, which is why they are worth marking in the source rather than only in a ticket: `DeviceFrame` and the colour picker call Flutter's `Theme.of`, and Flutter's `Theme.of` falls back to a default rather than throwing when the ancestor is `material_ui`'s `MaterialApp`. They compile and render — just with stock Material colours (FLU-704). Co-Authored-By: Claude Opus 5 (1M context) --- .../lib/config/theme_configuration.dart | 3 +++ .../lib/core/preview_wrapper.dart | 3 +++ .../theme_studio/color_picker_tile.dart | 3 +++ .../message/stream_message_text.dart | 3 +++ .../test/utils/material_localizations.dart | 3 +++ .../flutter/generated_plugin_registrant.cc | 11 +++++++++ .../flutter/generated_plugin_registrant.h | 15 ++++++++++++ .../linux/flutter/generated_plugins.cmake | 23 +++++++++++++++++++ 8 files changed, 64 insertions(+) create mode 100644 packages/stream_thumbnail/example/linux/flutter/generated_plugin_registrant.cc create mode 100644 packages/stream_thumbnail/example/linux/flutter/generated_plugin_registrant.h create mode 100644 packages/stream_thumbnail/example/linux/flutter/generated_plugins.cmake diff --git a/apps/design_system_gallery/lib/config/theme_configuration.dart b/apps/design_system_gallery/lib/config/theme_configuration.dart index bf383d1f..49c35d44 100644 --- a/apps/design_system_gallery/lib/config/theme_configuration.dart +++ b/apps/design_system_gallery/lib/config/theme_configuration.dart @@ -791,6 +791,9 @@ class ThemeConfiguration extends ChangeNotifier { /// Widgetbook still takes Flutter's `ThemeData`, which is an unrelated type /// to `material_ui`'s, so the branding is restated here over the same /// colors. Remove once Widgetbook migrates. + // + // TODO(material-ui): drop once widgetbook supports material_ui. + // https://linear.app/stream/issue/flu-703 flutter.ThemeData buildWidgetbookTheme() { final isDark = brightness == Brightness.dark; diff --git a/apps/design_system_gallery/lib/core/preview_wrapper.dart b/apps/design_system_gallery/lib/core/preview_wrapper.dart index 2a56e508..17317c7a 100644 --- a/apps/design_system_gallery/lib/core/preview_wrapper.dart +++ b/apps/design_system_gallery/lib/core/preview_wrapper.dart @@ -70,6 +70,9 @@ class PreviewWrapper extends StatelessWidget { return Center( child: Padding( padding: EdgeInsets.all(spacing.xl), + // TODO(material-ui): DeviceFrame reads Flutter's Theme, not + // material_ui's, so it renders with stock Material colors. + // https://linear.app/stream/issue/flu-704 child: DeviceFrame( device: previewConfig.selectedDevice, screen: content, diff --git a/apps/design_system_gallery/lib/widgets/theme_studio/color_picker_tile.dart b/apps/design_system_gallery/lib/widgets/theme_studio/color_picker_tile.dart index ec3ad135..6585498b 100644 --- a/apps/design_system_gallery/lib/widgets/theme_studio/color_picker_tile.dart +++ b/apps/design_system_gallery/lib/widgets/theme_studio/color_picker_tile.dart @@ -39,6 +39,9 @@ class ColorPickerTile extends StatelessWidget { return Padding( padding: EdgeInsets.only(bottom: spacing.xs + spacing.xxs), child: InkWell( + // TODO(material-ui): the picker reads Flutter's Theme, not + // material_ui's, so it renders with stock Material colors. + // https://linear.app/stream/issue/flu-704 onTap: () => _showColorPicker(context), borderRadius: BorderRadius.all(radius.sm), child: Container( diff --git a/packages/stream_core_flutter/lib/src/components/message/stream_message_text.dart b/packages/stream_core_flutter/lib/src/components/message/stream_message_text.dart index 5b21bcc4..965494f7 100644 --- a/packages/stream_core_flutter/lib/src/components/message/stream_message_text.dart +++ b/packages/stream_core_flutter/lib/src/components/message/stream_message_text.dart @@ -616,6 +616,9 @@ extension on ThemeData { /// /// `flutter_markdown_plus` still takes Flutter's `ThemeData`, which is an /// unrelated type to `material_ui`'s. Remove once it migrates. + // + // TODO(material-ui): drop once flutter_markdown_plus supports material_ui. + // https://linear.app/stream/issue/flu-701 flutter.ThemeData asFlutterMaterialTheme() { return flutter.ThemeData( colorScheme: flutter.ColorScheme( diff --git a/packages/stream_core_flutter/test/utils/material_localizations.dart b/packages/stream_core_flutter/test/utils/material_localizations.dart index 75582b3d..27ac23a7 100644 --- a/packages/stream_core_flutter/test/utils/material_localizations.dart +++ b/packages/stream_core_flutter/test/utils/material_localizations.dart @@ -8,6 +8,9 @@ import 'package:material_ui/material_ui.dart'; /// `MaterialLocalizations.of` directly — throws `No MaterialLocalizations /// found` and renders an error box instead. Widget tests do not need this: /// they wrap in `material_ui`'s `MaterialApp`, which supplies them. +// +// TODO(material-ui): drop once alchemist supports material_ui. +// https://linear.app/stream/issue/flu-702 Widget withMaterialLocalizations({required Widget child}) { return Localizations( locale: const Locale('en', 'US'), diff --git a/packages/stream_thumbnail/example/linux/flutter/generated_plugin_registrant.cc b/packages/stream_thumbnail/example/linux/flutter/generated_plugin_registrant.cc new file mode 100644 index 00000000..e71a16d2 --- /dev/null +++ b/packages/stream_thumbnail/example/linux/flutter/generated_plugin_registrant.cc @@ -0,0 +1,11 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#include "generated_plugin_registrant.h" + + +void fl_register_plugins(FlPluginRegistry* registry) { +} diff --git a/packages/stream_thumbnail/example/linux/flutter/generated_plugin_registrant.h b/packages/stream_thumbnail/example/linux/flutter/generated_plugin_registrant.h new file mode 100644 index 00000000..e0f0a47b --- /dev/null +++ b/packages/stream_thumbnail/example/linux/flutter/generated_plugin_registrant.h @@ -0,0 +1,15 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#ifndef GENERATED_PLUGIN_REGISTRANT_ +#define GENERATED_PLUGIN_REGISTRANT_ + +#include + +// Registers Flutter plugins. +void fl_register_plugins(FlPluginRegistry* registry); + +#endif // GENERATED_PLUGIN_REGISTRANT_ diff --git a/packages/stream_thumbnail/example/linux/flutter/generated_plugins.cmake b/packages/stream_thumbnail/example/linux/flutter/generated_plugins.cmake new file mode 100644 index 00000000..2e1de87a --- /dev/null +++ b/packages/stream_thumbnail/example/linux/flutter/generated_plugins.cmake @@ -0,0 +1,23 @@ +# +# Generated file, do not edit. +# + +list(APPEND FLUTTER_PLUGIN_LIST +) + +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + +set(PLUGIN_BUNDLED_LIBRARIES) + +foreach(plugin ${FLUTTER_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) + target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) + list(APPEND PLUGIN_BUNDLED_LIBRARIES $) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) +endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) From 97e115bb5c074c711a194fb70b5c80431541ff22 Mon Sep 17 00:00:00 2001 From: Sahil Kumar Date: Mon, 17 Aug 2026 13:12:36 +0200 Subject: [PATCH 7/7] refactor(ui): use MaterialUiCompatibilityBridge for the legacy dependencies MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `material_ui` ships a supported migration utility for exactly the case this PR was hand-rolling: `MaterialUiCompatibilityBridge` reads the modern theme from context and installs a legacy `Theme` plus legacy `Localizations` below it, so packages still built on `package:flutter/material.dart` resolve correctly inside a modern tree. Step 3 of the package's own migration guide. It replaces both bridges written here, and reaches cases neither of them covered. `StreamMessageText` now wraps `MarkdownBody` rather than mapping a theme by hand. Two gains beyond deleting ~30 lines: the mapping is upstream's and covers the whole `ColorScheme` and `TextTheme` instead of the five slots `fromTheme` happens to read today, and `MarkdownBody` itself — a legacy Material widget — finally has a legacy theme and localizations to resolve against, which it never did after the migration. A selectable markdown body needs those for its context menu. The bridge maps `platform`, `visualDensity`, `colorScheme` and `textTheme` and nothing else, so the legacy-only scalars `fromTheme` also reads — `cardColor`, `dividerColor`, `primaryColor`, `cardTheme.color` — are copied on top. Without that, an app setting `cardColor` explicitly would lose its code-block background. Pinned by the existing tests, which caught it. The gallery bridges at the app root via `MaterialApp.builder`, the pattern the guide recommends, which covers every legacy dependency below it at once: the colour-picker dialog that was silently rendering with stock Material colours, and DeviceFrame. `buildWidgetbookTheme` is gone — Widgetbook installs its own `MaterialApp.router` below the bridge, so its chrome takes the bridged theme by value instead, which is a fuller mapping than the 13 colours that method restated by hand. The prefixed imports are `as legacy`, matching the modern/legacy naming `material_ui` uses in `migration_utility.dart` itself. Alchemist is unaffected and keeps its own wrapper: that failure runs the other way — a modern widget needing modern localizations inside a legacy test harness — which is not what the bridge does. Locally: analyze, barrels and formatting clean; the golden failure set is the same 42 macOS-vs-Linux baseline with zero widget-library exceptions and zero `No MaterialLocalizations found`. Co-Authored-By: Claude Opus 5 (1M context) --- .../lib/app/gallery_app.dart | 8 ++ .../lib/app/gallery_shell.dart | 10 +- .../lib/config/theme_configuration.dart | 37 ----- .../lib/core/preview_wrapper.dart | 3 - .../theme_studio/color_picker_tile.dart | 3 - .../message/stream_message_text.dart | 128 ++++++++---------- 6 files changed, 73 insertions(+), 116 deletions(-) diff --git a/apps/design_system_gallery/lib/app/gallery_app.dart b/apps/design_system_gallery/lib/app/gallery_app.dart index c51ba0a2..6a698610 100644 --- a/apps/design_system_gallery/lib/app/gallery_app.dart +++ b/apps/design_system_gallery/lib/app/gallery_app.dart @@ -49,6 +49,14 @@ class _StreamDesignSystemGalleryState extends State { theme: materialTheme, darkTheme: materialTheme, themeMode: isDark ? .dark : .light, + // Maps the theme and localizations into Flutter's Material for the + // dependencies still built on it — Widgetbook, DeviceFrame, the + // colour picker — which would otherwise resolve stock defaults. + // + // TODO(material-ui): drop as each dependency migrates. + // https://linear.app/stream/issue/flu-698 + // ignore: deprecated_member_use + builder: (context, child) => MaterialUiCompatibilityBridge(child: child!), home: GalleryShell( showThemePanel: _showThemePanel, onToggleThemePanel: () => setState(() => _showThemePanel = !_showThemePanel), diff --git a/apps/design_system_gallery/lib/app/gallery_shell.dart b/apps/design_system_gallery/lib/app/gallery_shell.dart index ee9192e3..a1b57381 100644 --- a/apps/design_system_gallery/lib/app/gallery_shell.dart +++ b/apps/design_system_gallery/lib/app/gallery_shell.dart @@ -1,3 +1,5 @@ +// ignore: migrate_design_widgets +import 'package:flutter/material.dart' as legacy; import 'package:material_ui/material_ui.dart'; import 'package:provider/provider.dart'; import 'package:stream_core_flutter/core.dart'; @@ -33,7 +35,13 @@ class GalleryShell extends StatelessWidget { @override Widget build(BuildContext context) { final themeConfig = context.watch(); - final widgetbookTheme = themeConfig.buildWidgetbookTheme(); + // Widgetbook builds its own `MaterialApp.router`, which installs a theme of + // its own below the bridge — so the chrome takes the bridged theme by value + // rather than by inheritance. + // + // TODO(material-ui): drop once widgetbook supports material_ui. + // https://linear.app/stream/issue/flu-703 + final widgetbookTheme = legacy.Theme.of(context); final isDark = themeConfig.brightness == .dark; final screenWidth = MediaQuery.sizeOf(context).width; diff --git a/apps/design_system_gallery/lib/config/theme_configuration.dart b/apps/design_system_gallery/lib/config/theme_configuration.dart index 49c35d44..972673a2 100644 --- a/apps/design_system_gallery/lib/config/theme_configuration.dart +++ b/apps/design_system_gallery/lib/config/theme_configuration.dart @@ -1,5 +1,3 @@ -// ignore: migrate_design_widgets -import 'package:flutter/material.dart' as flutter; import 'package:material_ui/material_ui.dart'; import 'package:stream_core_flutter/core.dart'; @@ -785,39 +783,4 @@ class ThemeConfiguration extends ChangeNotifier { ), ); } - - /// Builds the Flutter Material theme that styles Widgetbook's own chrome. - /// - /// Widgetbook still takes Flutter's `ThemeData`, which is an unrelated type - /// to `material_ui`'s, so the branding is restated here over the same - /// colors. Remove once Widgetbook migrates. - // - // TODO(material-ui): drop once widgetbook supports material_ui. - // https://linear.app/stream/issue/flu-703 - flutter.ThemeData buildWidgetbookTheme() { - final isDark = brightness == Brightness.dark; - - return flutter.ThemeData( - colorScheme: (isDark ? flutter.ColorScheme.dark : flutter.ColorScheme.light)( - primary: accentPrimary, - secondary: accentPrimary, - tertiary: accentNeutral, - error: accentError, - surface: backgroundSurface, - surfaceContainerHighest: backgroundSurfaceSubtle, - onPrimary: textOnAccent, - onSecondary: textOnAccent, - onSurface: textPrimary, - onSurfaceVariant: textSecondary, - onError: textOnAccent, - outline: borderDefault, - outlineVariant: borderSubtle, - ), - scaffoldBackgroundColor: backgroundApp, - cardColor: backgroundSurface, - dividerColor: borderSubtle, - disabledColor: textDisabled, - hintColor: textTertiary, - ); - } } diff --git a/apps/design_system_gallery/lib/core/preview_wrapper.dart b/apps/design_system_gallery/lib/core/preview_wrapper.dart index 17317c7a..2a56e508 100644 --- a/apps/design_system_gallery/lib/core/preview_wrapper.dart +++ b/apps/design_system_gallery/lib/core/preview_wrapper.dart @@ -70,9 +70,6 @@ class PreviewWrapper extends StatelessWidget { return Center( child: Padding( padding: EdgeInsets.all(spacing.xl), - // TODO(material-ui): DeviceFrame reads Flutter's Theme, not - // material_ui's, so it renders with stock Material colors. - // https://linear.app/stream/issue/flu-704 child: DeviceFrame( device: previewConfig.selectedDevice, screen: content, diff --git a/apps/design_system_gallery/lib/widgets/theme_studio/color_picker_tile.dart b/apps/design_system_gallery/lib/widgets/theme_studio/color_picker_tile.dart index 6585498b..ec3ad135 100644 --- a/apps/design_system_gallery/lib/widgets/theme_studio/color_picker_tile.dart +++ b/apps/design_system_gallery/lib/widgets/theme_studio/color_picker_tile.dart @@ -39,9 +39,6 @@ class ColorPickerTile extends StatelessWidget { return Padding( padding: EdgeInsets.only(bottom: spacing.xs + spacing.xxs), child: InkWell( - // TODO(material-ui): the picker reads Flutter's Theme, not - // material_ui's, so it renders with stock Material colors. - // https://linear.app/stream/issue/flu-704 onTap: () => _showColorPicker(context), borderRadius: BorderRadius.all(radius.sm), child: Container( diff --git a/packages/stream_core_flutter/lib/src/components/message/stream_message_text.dart b/packages/stream_core_flutter/lib/src/components/message/stream_message_text.dart index 965494f7..2055fe0c 100644 --- a/packages/stream_core_flutter/lib/src/components/message/stream_message_text.dart +++ b/packages/stream_core_flutter/lib/src/components/message/stream_message_text.dart @@ -1,5 +1,5 @@ // ignore: migrate_design_widgets -import 'package:flutter/material.dart' as flutter; +import 'package:flutter/material.dart' as legacy; import 'package:flutter_markdown_plus/flutter_markdown_plus.dart'; import 'package:markdown/markdown.dart' as md; import 'package:material_ui/material_ui.dart'; @@ -341,23 +341,6 @@ class DefaultStreamMessageText extends StatelessWidget { effectiveTextStyle = effectiveTextStyle.merge(emojiStyle); } - final streamThemeData = Theme.of(context).let( - (it) => it.copyWith( - textTheme: it.textTheme.apply( - bodyColor: effectiveTextStyle.color, - decoration: effectiveTextStyle.decoration, - decorationColor: effectiveTextStyle.decorationColor, - decorationStyle: effectiveTextStyle.decorationStyle, - fontFamily: effectiveTextStyle.fontFamily, - fontFamilyFallback: effectiveTextStyle.fontFamilyFallback, - ), - ), - ); - - final markdownSheet = MarkdownStyleSheet.fromTheme( - streamThemeData.asFlutterMaterialTheme(), // Apply stream theme data - ).copyWith(p: effectiveTextStyle, a: effectiveLinkStyle).merge(props.styleSheet); - // Prepend mention syntax so `[text](mention[-type]:id)` is intercepted // before the standard LinkSyntax, producing `mention` elements. // Regular `a` elements are never touched. @@ -383,24 +366,63 @@ class DefaultStreamMessageText extends StatelessWidget { ...?props.builders, }; + // `flutter_markdown_plus` is still built on Flutter's Material, whose + // `ThemeData` and `MaterialLocalizations` are unrelated types to + // `material_ui`'s. The bridge maps the ambient theme into that universe so + // the style sheet, and everything `MarkdownBody` builds, resolve. + // + // TODO(material-ui): drop once flutter_markdown_plus supports material_ui. + // https://linear.app/stream/issue/flu-701 return Padding( padding: effectivePadding, - child: MarkdownBody( - data: props.text, - selectable: props.selectable, - styleSheet: markdownSheet, - styleSheetTheme: .platform, - syntaxHighlighter: props.syntaxHighlighter, - onTapLink: props.onTapLink, - onTapText: props.onTapText, - imageBuilder: props.imageBuilder, - builders: effectiveBuilders, - paddingBuilders: props.paddingBuilders ?? const {}, - blockSyntaxes: props.blockSyntaxes, - inlineSyntaxes: effectiveInlineSyntaxes, - extensionSet: props.extensionSet, - softLineBreak: props.softLineBreak, - fitContent: props.fitContent, + // ignore: deprecated_member_use + child: MaterialUiCompatibilityBridge( + child: Builder( + builder: (context) { + // The bridge maps the colour scheme and text theme but not the + // legacy-only scalars, and `fromTheme` reads all four. + final theme = Theme.of(context); + + final markdownTheme = legacy.Theme.of(context).let( + (it) => it.copyWith( + primaryColor: theme.primaryColor, + cardColor: theme.cardColor, + dividerColor: theme.dividerColor, + cardTheme: legacy.CardThemeData(color: theme.cardTheme.color), + textTheme: it.textTheme.apply( + bodyColor: effectiveTextStyle.color, + decoration: effectiveTextStyle.decoration, + decorationColor: effectiveTextStyle.decorationColor, + decorationStyle: effectiveTextStyle.decorationStyle, + fontFamily: effectiveTextStyle.fontFamily, + fontFamilyFallback: effectiveTextStyle.fontFamilyFallback, + ), + ), + ); + + final markdownSheet = MarkdownStyleSheet.fromTheme( + markdownTheme, + ).copyWith(p: effectiveTextStyle, a: effectiveLinkStyle).merge(props.styleSheet); + + return MarkdownBody( + data: props.text, + selectable: props.selectable, + styleSheet: markdownSheet, + styleSheetTheme: .platform, + syntaxHighlighter: props.syntaxHighlighter, + onTapLink: props.onTapLink, + onTapText: props.onTapText, + imageBuilder: props.imageBuilder, + builders: effectiveBuilders, + paddingBuilders: props.paddingBuilders ?? const {}, + blockSyntaxes: props.blockSyntaxes, + inlineSyntaxes: effectiveInlineSyntaxes, + extensionSet: props.extensionSet, + softLineBreak: props.softLineBreak, + fitContent: props.fitContent, + ); + }, + ), ), ); } @@ -609,41 +631,3 @@ class _StreamMessageTextDefaults extends StreamMessageTextStyle { return .all(.new(fontSize: StreamEmojiSize.lg.value, height: 1)); } } - -extension on ThemeData { - /// Restates this theme as a Flutter Material [flutter.ThemeData] carrying the - /// fields [MarkdownStyleSheet.fromTheme] reads. - /// - /// `flutter_markdown_plus` still takes Flutter's `ThemeData`, which is an - /// unrelated type to `material_ui`'s. Remove once it migrates. - // - // TODO(material-ui): drop once flutter_markdown_plus supports material_ui. - // https://linear.app/stream/issue/flu-701 - flutter.ThemeData asFlutterMaterialTheme() { - return flutter.ThemeData( - colorScheme: flutter.ColorScheme( - brightness: colorScheme.brightness, - primary: colorScheme.primary, - onPrimary: colorScheme.onPrimary, - secondary: colorScheme.secondary, - onSecondary: colorScheme.onSecondary, - error: colorScheme.error, - onError: colorScheme.onError, - surface: colorScheme.surface, - onSurface: colorScheme.onSurface, - surfaceContainerHighest: colorScheme.surfaceContainerHighest, - ), - primaryColor: primaryColor, - cardColor: cardColor, - dividerColor: dividerColor, - cardTheme: flutter.CardThemeData(color: cardTheme.color), - textTheme: flutter.TextTheme( - bodyLarge: textTheme.bodyLarge, - bodyMedium: textTheme.bodyMedium, - headlineSmall: textTheme.headlineSmall, - titleLarge: textTheme.titleLarge, - titleMedium: textTheme.titleMedium, - ), - ); - } -}