Skip to content

Remove Material import from focus_traversal_test.dart#180994

Merged
auto-submit[bot] merged 5 commits intoflutter:masterfrom
navaronbracke:focus_traversal_test_no_material
Feb 10, 2026
Merged

Remove Material import from focus_traversal_test.dart#180994
auto-submit[bot] merged 5 commits intoflutter:masterfrom
navaronbracke:focus_traversal_test_no_material

Conversation

@navaronbracke
Copy link
Contributor

@navaronbracke navaronbracke commented Jan 14, 2026

This PR removes the material import from test/widgets/focus_traversal_test.dart

Part of #177415

If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.

Pre-launch Checklist

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

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

@github-actions github-actions bot added framework flutter/packages/flutter repository. See also f: labels. f: scrolling Viewports, list views, slivers, etc. f: focus Focus traversal, gaining or losing focus labels Jan 14, 2026
Copy link
Contributor

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

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 successfully removes material.dart imports from focus_traversal_test.dart and linked_scroll_view_test.dart by introducing custom test utilities in widget_test_utils.dart. This is a positive change that improves the modularity and reduces dependencies in the test suite, aligning with the goal of isolating widget tests from specific design systems. The new widget_test_utils.dart file provides generic replacements for MaterialApp, MaterialPageRoute, MaterialPage, ElevatedButton, TextButton, and Colors.primaries, allowing the tests to function correctly without relying on the Material Design library. The removal of TestRoute and Divider further cleans up the test code.

@navaronbracke navaronbracke force-pushed the focus_traversal_test_no_material branch from 19e105c to 4ae12c1 Compare January 15, 2026 07:46
@github-actions github-actions bot removed the f: scrolling Viewports, list views, slivers, etc. label Jan 15, 2026
@navaronbracke navaronbracke changed the title Remove material import from focus_traversal_test.dart Remove material buttons and routes from focus_traversal_test.dart Jan 15, 2026
@navaronbracke navaronbracke changed the title Remove material buttons and routes from focus_traversal_test.dart Remove material buttons and material routes from focus_traversal_test.dart Jan 15, 2026
Copy link
Contributor

@justinmc justinmc left a comment

Choose a reason for hiding this comment

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

Just some quick questions, otherwise looks good.

@justinmc I noticed that there are many versions of TestPage classes in tests. Do I file a follow-up issue to address that?

Yes that would be great! I guess you're planning to create one reusable class in your utils file?

Copy link
Contributor

@justinmc justinmc left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@navaronbracke navaronbracke force-pushed the focus_traversal_test_no_material branch from 921ecf8 to 42092e6 Compare January 19, 2026 08:00
@justinmc
Copy link
Contributor

Heads up that there's an analyzer failure here.

@navaronbracke
Copy link
Contributor Author

I'll take a look!

@navaronbracke navaronbracke force-pushed the focus_traversal_test_no_material branch from 4336563 to c027894 Compare January 20, 2026 18:48
@justinmc justinmc self-requested a review January 20, 2026 23:10
@navaronbracke navaronbracke force-pushed the focus_traversal_test_no_material branch from c027894 to e2b6274 Compare January 30, 2026 14:21
@navaronbracke
Copy link
Contributor Author

Since we now have TestWidgetsApp, I will update this PR directly

@navaronbracke navaronbracke force-pushed the focus_traversal_test_no_material branch from e2b6274 to 163a866 Compare January 30, 2026 14:36
@navaronbracke navaronbracke changed the title Remove material buttons and material routes from focus_traversal_test.dart Remove Material import from focus_traversal_test.dart Jan 30, 2026
@navaronbracke
Copy link
Contributor Author

@justinmc We can do this file in one PR now that TestWidgetsApp is done

Copy link
Contributor

@justinmc justinmc left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Comment on lines -3204 to +3205
await tester.pumpWidget(
WidgetsApp(
color: Colors.white,
onGenerateRoute: (RouteSettings settings) => PageRouteBuilder<void>(
settings: settings,
pageBuilder:
(
BuildContext context,
Animation<double> animation1,
Animation<double> animation2,
) {
return const Placeholder();
},
),
),
);
await tester.pumpWidget(const TestWidgetsApp(home: Placeholder()));
Copy link
Contributor

Choose a reason for hiding this comment

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

What a clear win for TestWidgetsApp here.

@navaronbracke navaronbracke added the autosubmit Merge PR when tree becomes green via auto submit App label Feb 10, 2026
@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Feb 10, 2026
@auto-submit
Copy link
Contributor

auto-submit bot commented Feb 10, 2026

autosubmit label was removed for flutter/flutter/180994, 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.

@navaronbracke navaronbracke force-pushed the focus_traversal_test_no_material branch from 163a866 to f4e705e Compare February 10, 2026 07:34
@navaronbracke navaronbracke added the autosubmit Merge PR when tree becomes green via auto submit App label Feb 10, 2026
@auto-submit auto-submit bot added this pull request to the merge queue Feb 10, 2026
Merged via the queue into flutter:master with commit 9bda20a Feb 10, 2026
149 of 150 checks passed
@flutter-dashboard flutter-dashboard bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Feb 10, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 10, 2026
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Feb 10, 2026
Roll Flutter from e8f9dc50356d to 9bda20a11f1e (34 revisions)

flutter/flutter@e8f9dc5...9bda20a

2026-02-10 [email protected] Remove Material import from focus_traversal_test.dart (flutter/flutter#180994)
2026-02-10 [email protected] Roll Skia from 6e217430c052 to cffb3bf918df (1 revision) (flutter/flutter#182131)
2026-02-10 [email protected] Encourage splitting large test files in testing documentation 2 (flutter/flutter#182051)
2026-02-10 [email protected] refactor: migrate CupertinoPageTransitionsBuilder to cupertino folder (flutter/flutter#179776)
2026-02-10 [email protected] Delete the last remaining skia only fragment shader tests (flutter/flutter#182127)
2026-02-10 [email protected] [a11y][android] Set new CheckState APIs for android API 36  (flutter/flutter#182113)
2026-02-10 [email protected] Add missing dependencies to framework_tests_misc_leak_tracking (flutter/flutter#181929)
2026-02-10 [email protected] Roll Dart SDK from eee0e2e11174 to 69eb951f8f7e (2 revisions) (flutter/flutter#182128)
2026-02-10 [email protected] Marks Linux_android_emu android_display_cutout to be flaky (flutter/flutter#181901)
2026-02-10 [email protected] Bump Dart to 3.10 (flutter/flutter#174066)
2026-02-10 [email protected] Roll Skia from d4b7e24a209b to 6e217430c052 (6 revisions) (flutter/flutter#182126)
2026-02-09 [email protected] Intercept UIScene device log and print a guided warning (flutter/flutter#181515)
2026-02-09 [email protected] Introduce ScrollCacheExtent and also fixes unbound shrinkwrap cache ex… (flutter/flutter#181092)
2026-02-09 [email protected] [Android] Add mechanism for setting Android engine flags via Android manifest (take 2) (flutter/flutter#181632)
2026-02-09 [email protected] Fix wrong comment about default impeller value (flutter/flutter#181831)
2026-02-09 [email protected] fix build fail for wayland only platform (flutter/flutter#182057)
2026-02-09 [email protected] [AGP 9] Added Warning Against Updating to AGP 9 (flutter/flutter#181977)
2026-02-09 [email protected] Updated Shaderc dep (flutter/flutter#180976)
2026-02-09 [email protected] Refactor accessibility guidelines out to widget layer (flutter/flutter#181672)
2026-02-09 [email protected] Roll Skia from 68dff53238e5 to d4b7e24a209b (2 revisions) (flutter/flutter#182087)
2026-02-09 [email protected] fix: OutlineInputBorder not respecting BorderSide stroke alignment (flutter/flutter#180487)
2026-02-09 [email protected] Adds opengles to engine dart tests (flutter/flutter#181933)
2026-02-09 [email protected] Add command to build a Swift Package for Add to App and generate FlutterPluginRegistrant (flutter/flutter#181224)
2026-02-09 [email protected] Remove unused constant in `bundle.dart` (flutter/flutter#182023)
2026-02-09 [email protected] Roll Fuchsia Linux SDK from iqtwdXlgKIyZkL5Li... to 7BGf7mPQvgLi7Axb6... (flutter/flutter#182082)
2026-02-09 [email protected] Remove unused getters in `user_messages.dart` (flutter/flutter#181867)
2026-02-09 [email protected] Roll Packages from 7805d3e to 3d5eaa5 (3 revisions) (flutter/flutter#182083)
2026-02-09 [email protected] Roll Skia from 5d891cd7fb7f to 68dff53238e5 (1 revision) (flutter/flutter#182080)
2026-02-09 [email protected] Update example description (flutter/flutter#182067)
2026-02-09 [email protected] Roll Dart SDK from 965b51c219d3 to eee0e2e11174 (1 revision) (flutter/flutter#182073)
2026-02-09 [email protected] Roll Skia from 9533d7533d59 to 5d891cd7fb7f (6 revisions) (flutter/flutter#182070)
2026-02-09 [email protected] Add a new flutter cli command, running-apps, using mDNS app discovery (flutter/flutter#180098)
2026-02-09 [email protected] Roll Skia from b7db9f35f0f2 to 9533d7533d59 (2 revisions) (flutter/flutter#182069)
2026-02-08 [email protected] Improve FlWindowMonitor API (flutter/flutter#181885)

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 [email protected],[email protected] 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

...
rickhohler pushed a commit to rickhohler/flutter that referenced this pull request Feb 19, 2026
This PR removes the material import from
`test/widgets/focus_traversal_test.dart`

Part of flutter#177415

*If you had to change anything in the [flutter/tests] repo, include a
link to the migration guide as per the [breaking change policy].*

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

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

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

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
@navaronbracke navaronbracke deleted the focus_traversal_test_no_material branch March 5, 2026 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

f: focus Focus traversal, gaining or losing focus framework flutter/packages/flutter repository. See also f: labels.

Projects

Development

Successfully merging this pull request may close these issues.

3 participants