Skip to content

Remove Material import from implicit animation tests#186673

Merged
auto-submit[bot] merged 11 commits into
flutter:masterfrom
MarlonJD:implicit-animations-no-material
Jun 9, 2026
Merged

Remove Material import from implicit animation tests#186673
auto-submit[bot] merged 11 commits into
flutter:masterfrom
MarlonJD:implicit-animations-no-material

Conversation

@MarlonJD

@MarlonJD MarlonJD commented May 18, 2026

Copy link
Copy Markdown
Contributor

Part of #177412
Refs #177028

This removes the package:flutter/material.dart dependency from the widgets implicit animation tests by replacing the Material Switch toggle with a widgets-only gesture target and using explicit Color values.

It also moves the Material-specific AnimatedTheme onEnd coverage into packages/flutter/test/material/animated_theme_test.dart, keeping widgets/implicit_animations_test.dart free of Material dependencies.

Validation:

  • bin/cache/dart-sdk/bin/dart --enable-asserts dev/bots/check_tests_cross_imports.dart
  • dart analyze packages/flutter/test/widgets/implicit_animations_test.dart packages/flutter/test/material/animated_theme_test.dart dev/bots/check_tests_cross_imports.dart
  • ./bin/flutter test packages/flutter/test/widgets/implicit_animations_test.dart packages/flutter/test/material/animated_theme_test.dart

@github-actions github-actions Bot added framework flutter/packages/flutter repository. See also f: labels. a: animation Animation APIs f: material design flutter/packages/flutter/material repository. labels May 18, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the testing infrastructure for implicit animations by introducing a helper method for toggling widgets and consolidating test structures. It includes the addition of a new test file for AnimatedTheme, updates to existing tests in implicit_animations_test.dart, and the use of explicit color constants throughout the test suite to improve consistency and performance.

Comment thread packages/flutter/test/widgets/implicit_animations_test.dart Outdated
@MarlonJD

Copy link
Copy Markdown
Contributor Author

Re-checked the const-color feedback: the referenced literals are already in a const widget tree, and adding explicit const there produces unnecessary_const. Re-verified locally with dart analyze packages/flutter/test/widgets/implicit_animations_test.dart packages/flutter/test/material/animated_theme_test.dart and ./bin/flutter test on both files.

@victorsanni victorsanni added the CICD Run CI/CD label May 18, 2026

@victorsanni victorsanni left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

do we need to remove widgets/implicit_animations_test.dart from dev/bots/check_tests_cross_imports.dart?

@github-actions github-actions Bot removed the CICD Run CI/CD label May 19, 2026
@victorsanni victorsanni moved this from Todo to In Progress in Test cross-imports Review Queue May 19, 2026
@victorsanni victorsanni added CICD Run CI/CD override code freeze Override an active code freeze. labels May 19, 2026
Comment thread packages/flutter/test/material/animated_theme_test.dart Outdated
@github-actions github-actions Bot removed the CICD Run CI/CD label May 20, 2026
@MarlonJD

Copy link
Copy Markdown
Contributor Author

Thanks for the review! I inlined the tap sequence into the test and removed the single-use helper in 101d088.

For the cross-import allowlist: yes, removing widgets/implicit_animations_test.dart is needed because it no longer imports Material, and the checker reports fixed allowlist entries if they are left behind.

Re-verified locally:

  • dart analyze packages/flutter/test/widgets/implicit_animations_test.dart packages/flutter/test/material/animated_theme_test.dart
  • dart --enable-asserts dev/bots/check_tests_cross_imports.dart
  • ./bin/flutter test packages/flutter/test/widgets/implicit_animations_test.dart packages/flutter/test/material/animated_theme_test.dart

All passed.

@MarlonJD

Copy link
Copy Markdown
Contributor Author

@victorsanni This should be ready for re-review.

Since your last review:

  • Removed widgets/implicit_animations_test.dart from the widgets cross-import allowlist as requested.
  • Removed the single-use helper.
  • Re-ran the cross-import checker, analyze, and the targeted tests; they pass.

Validation:

  • bin/cache/dart-sdk/bin/dart --enable-asserts dev/bots/check_tests_cross_imports.dart
  • dart analyze packages/flutter/test/widgets/implicit_animations_test.dart packages/flutter/test/material/animated_theme_test.dart dev/bots/check_tests_cross_imports.dart
  • ./bin/flutter test packages/flutter/test/widgets/implicit_animations_test.dart packages/flutter/test/material/animated_theme_test.dart

@MarlonJD MarlonJD requested a review from victorsanni May 22, 2026 12:25
victorsanni
victorsanni previously approved these changes May 29, 2026
@auto-submit

auto-submit Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

autosubmit label was removed for flutter/flutter/186673, because The base commit of the PR is older than 7 days and can not be merged. Please merge the latest changes from the main into this branch and resubmit the PR.

@github-actions github-actions Bot removed the CICD Run CI/CD label Jun 7, 2026
@rkishan516 rkishan516 added CICD Run CI/CD autosubmit Merge PR when tree becomes green via auto submit App labels Jun 7, 2026
@auto-submit auto-submit Bot added this pull request to the merge queue Jun 7, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Jun 7, 2026
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jun 7, 2026
…ns-no-material

# Conflicts:
#	dev/bots/check_tests_cross_imports.dart
@MarlonJD MarlonJD dismissed stale reviews from victorsanni and rkishan516 via dcc0b22 June 7, 2026 18:10
@github-actions github-actions Bot removed the CICD Run CI/CD label Jun 7, 2026
@MarlonJD

MarlonJD commented Jun 7, 2026

Copy link
Copy Markdown
Contributor Author

Updated the branch by merging the latest upstream/master in dcc0b22501f.

The merge conflict in dev/bots/check_tests_cross_imports.dart was resolved by:

  • Keeping implicit_animations_test.dart out of the widgets cross-import allowlist.
  • Removing navigator_replacement_test.dart too, since the checker now reports it as fixed.

Validation run locally:

  • bin/cache/dart-sdk/bin/dart --enable-asserts dev/bots/check_tests_cross_imports.dart
  • bin/cache/dart-sdk/bin/dart analyze packages/flutter/test/widgets/implicit_animations_test.dart packages/flutter/test/material/animated_theme_test.dart packages/flutter/test/widgets/navigator_replacement_test.dart dev/bots/check_tests_cross_imports.dart
  • ./bin/flutter test packages/flutter/test/widgets/implicit_animations_test.dart packages/flutter/test/material/animated_theme_test.dart

I also tried to restore the autosubmit label, but GitHub rejected it with AddLabelsToLabelable permission denied for my account, so a maintainer will need to re-add it.

@rkishan516 rkishan516 added the CICD Run CI/CD label Jun 9, 2026

@rkishan516 rkishan516 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Re-LGTM

@victorsanni victorsanni added the autosubmit Merge PR when tree becomes green via auto submit App label Jun 9, 2026
@auto-submit auto-submit Bot added this pull request to the merge queue Jun 9, 2026
Merged via the queue into flutter:master with commit 1d5ce4c Jun 9, 2026
174 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Test cross-imports Review Queue Jun 9, 2026
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jun 9, 2026
@MarlonJD MarlonJD deleted the implicit-animations-no-material branch June 9, 2026 20:39
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Jun 11, 2026
flutter/flutter@66aaa9a...c0a1129

2026-06-10 137456488+flutter-pub-roller-bot@users.noreply.github.com Roll pub packages (flutter/flutter#187740)
2026-06-09 burak.karahan@mail.ru Remove Material import from view chrome style test (flutter/flutter#186994)
2026-06-09 jason-simmons@users.noreply.github.com [Impeller] Remove unused DeviceHolderVK reference from CommandBufferVK (flutter/flutter#187705)
2026-06-09 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from KNe93cf5wU4xG2d-m... to 8azSyvz57mKcPqTwk... (flutter/flutter#187745)
2026-06-09 1063596+reidbaker@users.noreply.github.com Add android-agent agent.json and update reidbaker-agent skills (flutter/flutter#187746)
2026-06-09 engine-flutter-autoroll@skia.org Roll Skia from aeed11c35004 to 9f02102df298 (9 revisions) (flutter/flutter#187744)
2026-06-09 bdero@google.com [Impeller] Remove the texture coordinate system Y-flip workaround (flutter/flutter#187686)
2026-06-09 41687333+rlueders@users.noreply.github.com [Impeller] Retry uncompressed when fixed-rate compression is exhausted (flutter/flutter#187586)
2026-06-09 burak.karahan@mail.ru Remove Material import from implicit animation tests (flutter/flutter#186673)
2026-06-09 engine-flutter-autoroll@skia.org Roll Packages from 13b49f4 to bd297cf (4 revisions) (flutter/flutter#187739)
2026-06-09 30870216+gaaclarke@users.noreply.github.com Updates dia_dll.py to support vs2026 (flutter/flutter#187714)
2026-06-09 bdero@google.com [Flutter GPU] Allow attaching specific texture mip levels and slices for rendering (flutter/flutter#187685)
2026-06-09 engine-flutter-autoroll@skia.org Roll Dart SDK from 39f1c44e294f to f3441f2067ae (1 revision) (flutter/flutter#187711)
2026-06-09 bdero@google.com [flutter_tools] Hot reload Flutter GPU shader bundles (flutter/flutter#187654)
2026-06-09 katelovett@google.com Update triage links (flutter/flutter#187709)
2026-06-09 engine-flutter-autoroll@skia.org Roll Skia from 43f135735152 to aeed11c35004 (11 revisions) (flutter/flutter#187721)
2026-06-09 jason-simmons@users.noreply.github.com Use workspace resolution for the meta package in dev/integration_tests/record_use_test_package (flutter/flutter#187733)

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

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

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

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
via-guy pushed a commit to via-guy/flutter that referenced this pull request Jun 26, 2026
Part of flutter#177412
Refs flutter#177028

This removes the package:flutter/material.dart dependency from the
widgets implicit animation tests by replacing the Material Switch toggle
with a widgets-only gesture target and using explicit Color values.

It also moves the Material-specific AnimatedTheme onEnd coverage into
packages/flutter/test/material/animated_theme_test.dart, keeping
widgets/implicit_animations_test.dart free of Material dependencies.

Validation:
- bin/cache/dart-sdk/bin/dart --enable-asserts
dev/bots/check_tests_cross_imports.dart
- dart analyze
packages/flutter/test/widgets/implicit_animations_test.dart
packages/flutter/test/material/animated_theme_test.dart
dev/bots/check_tests_cross_imports.dart
- ./bin/flutter test
packages/flutter/test/widgets/implicit_animations_test.dart
packages/flutter/test/material/animated_theme_test.dart

---------

Co-authored-by: Victor Sanni <victorsanniay@gmail.com>
Co-authored-by: Kishan Rathore <34465683+rkishan516@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: animation Animation APIs CICD Run CI/CD f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. override code freeze Override an active code freeze.

Projects

Development

Successfully merging this pull request may close these issues.

4 participants