Skip to content

Remove Material import from navigator replacement tests#186674

Merged
auto-submit[bot] merged 10 commits into
flutter:masterfrom
MarlonJD:navigator-replacement-no-material
Jun 7, 2026
Merged

Remove Material import from navigator replacement tests#186674
auto-submit[bot] merged 10 commits into
flutter:masterfrom
MarlonJD:navigator-replacement-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 navigator replacement widget tests. The tests now use the widgets-only TestWidgetsApp helper with an explicit PageRouteBuilder for transition coverage and an explicit HeroController for the Hero assertions.

Validation:

  • dart analyze packages/flutter/test/widgets/navigator_replacement_test.dart
  • ./bin/flutter test packages/flutter/test/widgets/navigator_replacement_test.dart

@github-actions github-actions Bot added framework flutter/packages/flutter repository. See also f: labels. f: routes Navigator, Router, and related APIs. 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 navigator_replacement_test.dart to use widgets.dart instead of material.dart, replacing MaterialApp and Material widgets with a custom _buildApp helper and TestWidgetsApp. The reviewer identified that the newly added private helper functions, _buildApp and _pageRouteBuilder, lack public-quality documentation using ///, which is a requirement of the Flutter style guide even for private members.

Comment thread packages/flutter/test/widgets/navigator_replacement_test.dart
Comment thread packages/flutter/test/widgets/navigator_replacement_test.dart
@MarlonJD

Copy link
Copy Markdown
Contributor Author

Addressed the helper documentation feedback and re-verified locally with dart analyze packages/flutter/test/widgets/navigator_replacement_test.dart and ./bin/flutter test packages/flutter/test/widgets/navigator_replacement_test.dart.

@MarlonJD MarlonJD changed the base branch from main to master May 18, 2026 18:28

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

This file should be removed from knownWidgetsCrossImports in dev/bots/check_tests_cross_imports.dart.

@MarlonJD

MarlonJD commented May 18, 2026

Copy link
Copy Markdown
Contributor Author

Removed packages/flutter/test/widgets/navigator_replacement_test.dart from knownWidgetsCrossImports and verified with dart --enable-asserts 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
@github-actions github-actions Bot removed the CICD Run CI/CD label May 20, 2026
@MarlonJD MarlonJD requested a review from victorsanni May 22, 2026 12:26
@MarlonJD

Copy link
Copy Markdown
Contributor Author

Maintainer label request: please add CICD. This PR is approved, mergeable, and Google testing is green; it is waiting on the presubmit label.

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

Overall LGTM

}

/// Builds a [TestWidgetsApp] for navigator replacement tests.
Widget _buildApp({

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This feels like over abstraction

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.

+1 here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks, I kept _buildApp to avoid repeating the widgets-only TestWidgetsApp setup across the tests after removing MaterialApp, especially the shared pageRouteBuilder, HeroController, and textStyle wiring. I can inline it if you still prefer; I was trying to keep each test focused on the navigator behavior rather than the app scaffolding.

@rkishan516 rkishan516 added the CICD Run CI/CD label May 22, 2026
@MarlonJD

Copy link
Copy Markdown
Contributor Author

@victorsanni This is approved and presubmits are green. Could you please autosubmit/land it when you get a chance?

@github-actions github-actions Bot removed the CICD Run CI/CD label May 27, 2026
@MarlonJD

Copy link
Copy Markdown
Contributor Author

I refreshed the branch after auto-submit removed the label due to the stale base commit. This is still approved; could you please re-add autosubmit when you get a chance?

@Piinks Piinks added CICD Run CI/CD autosubmit Merge PR when tree becomes green via auto submit App and removed override code freeze Override an active code freeze. labels Jun 2, 2026
@auto-submit

auto-submit Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

autosubmit label was removed for flutter/flutter/186674, because - The status or check suite Linux analyze has failed. Please fix the issues identified (or deflake) before re-applying this label.

@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jun 2, 2026
@github-actions github-actions Bot removed the CICD Run CI/CD label Jun 2, 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
Merged via the queue into flutter:master with commit b19de42 Jun 7, 2026
181 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jun 7, 2026
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Test cross-imports Review Queue Jun 7, 2026
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Jun 10, 2026
flutter/flutter@1bdf4af...66aaa9a

2026-06-08 katelovett@google.com Add docs on bumping Dart (flutter/flutter#187540)
2026-06-08 rmacnak@google.com Rename Dart_LoadELF2 back to Dart_LoadELF. (flutter/flutter#187677)
2026-06-08 1063596+reidbaker@users.noreply.github.com Add bare, reidbaker, and android agents (flutter/flutter#187588)
2026-06-08 engine-flutter-autoroll@skia.org Roll Dart SDK from 73ec2745c49a to 39f1c44e294f (3 revisions) (flutter/flutter#187684)
2026-06-08 bdero@google.com [Flutter GPU] Document the formats.dart enums (flutter/flutter#187628)
2026-06-08 engine-flutter-autoroll@skia.org Roll Skia from 0ea3dae686e3 to 43f135735152 (3 revisions) (flutter/flutter#187683)
2026-06-08 bdero@google.com [flutter_tools] Fix `flutter create` crash with SDK packages in bin/cache/pkg (flutter/flutter#187653)
2026-06-08 engine-flutter-autoroll@skia.org Roll Packages from 61bdbb4 to 13b49f4 (1 revision) (flutter/flutter#187678)
2026-06-08 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from fAGotRbStYGA0idum... to KNe93cf5wU4xG2d-m... (flutter/flutter#187675)
2026-06-08 engine-flutter-autoroll@skia.org Roll Skia from d17c51db4ede to 0ea3dae686e3 (1 revision) (flutter/flutter#187674)
2026-06-08 engine-flutter-autoroll@skia.org Roll Skia from 9659a87f500f to d17c51db4ede (2 revisions) (flutter/flutter#187672)
2026-06-08 engine-flutter-autoroll@skia.org Roll Skia from a56d5a4e1120 to 9659a87f500f (1 revision) (flutter/flutter#187667)
2026-06-07 engine-flutter-autoroll@skia.org Roll Skia from 101faf7d9d1f to a56d5a4e1120 (1 revision) (flutter/flutter#187665)
2026-06-07 burak.karahan@mail.ru Remove Material import from navigator replacement tests (flutter/flutter#186674)
2026-06-07 burak.karahan@mail.ru Remove Material import from editable text cursor tests (flutter/flutter#186671)
2026-06-07 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from eIU3QDrxaBPAMY9oi... to fAGotRbStYGA0idum... (flutter/flutter#187656)
2026-06-07 engine-flutter-autoroll@skia.org Roll Skia from 294ac0cb2a7d to 101faf7d9d1f (1 revision) (flutter/flutter#187655)
2026-06-06 engine-flutter-autoroll@skia.org Roll Skia from 91ee612cf552 to 294ac0cb2a7d (2 revisions) (flutter/flutter#187651)
2026-06-06 engine-flutter-autoroll@skia.org Roll Skia from a47a9a2c8ae5 to 91ee612cf552 (4 revisions) (flutter/flutter#187642)
2026-06-06 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from N_LiSaBSUsE2LDZgG... to eIU3QDrxaBPAMY9oi... (flutter/flutter#187641)
2026-06-06 engine-flutter-autoroll@skia.org Roll Dart SDK from 05243f181c21 to 73ec2745c49a (2 revisions) (flutter/flutter#187640)
2026-06-06 engine-flutter-autoroll@skia.org Roll Fuchsia GN SDK from oOAcFhkoE2_-Sy67z... to a87CbQSWEjkPUK1ZY... (flutter/flutter#187632)
2026-06-06 engine-flutter-autoroll@skia.org Roll Dart SDK from 6a9a0efe66eb to 05243f181c21 (1 revision) (flutter/flutter#187634)
2026-06-05 bdero@google.com [Flutter GPU] Add instanced draw support (flutter/flutter#187359)
2026-06-05 30870216+gaaclarke@users.noreply.github.com clears out the android context after the frame on mediatek devices (flutter/flutter#187404)
2026-06-05 kevmoo@users.noreply.github.com fix(tool): initialize asset isModified state on startup to prevent 2x hot restart slowdown (flutter/flutter#187488)
2026-06-05 magder@google.com Remove reference to 'good first issue' in the docs (flutter/flutter#187615)
2026-06-05 stuartmorgan@google.com Remove references to 'good first issue' (flutter/flutter#187617)
2026-06-05 154381524+flutteractionsbot@users.noreply.github.com Revert "Add support for stylus buttons" (flutter/flutter#187581)
2026-06-05 6655696+guidezpl@users.noreply.github.com Always run coverage upload step, even if a single test fails (flutter/flutter#187614)

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
creatorpiyush pushed a commit to creatorpiyush/packages that referenced this pull request Jun 10, 2026
…r#11876)

flutter/flutter@1bdf4af...66aaa9a

2026-06-08 katelovett@google.com Add docs on bumping Dart (flutter/flutter#187540)
2026-06-08 rmacnak@google.com Rename Dart_LoadELF2 back to Dart_LoadELF. (flutter/flutter#187677)
2026-06-08 1063596+reidbaker@users.noreply.github.com Add bare, reidbaker, and android agents (flutter/flutter#187588)
2026-06-08 engine-flutter-autoroll@skia.org Roll Dart SDK from 73ec2745c49a to 39f1c44e294f (3 revisions) (flutter/flutter#187684)
2026-06-08 bdero@google.com [Flutter GPU] Document the formats.dart enums (flutter/flutter#187628)
2026-06-08 engine-flutter-autoroll@skia.org Roll Skia from 0ea3dae686e3 to 43f135735152 (3 revisions) (flutter/flutter#187683)
2026-06-08 bdero@google.com [flutter_tools] Fix `flutter create` crash with SDK packages in bin/cache/pkg (flutter/flutter#187653)
2026-06-08 engine-flutter-autoroll@skia.org Roll Packages from 61bdbb4 to 13b49f4 (1 revision) (flutter/flutter#187678)
2026-06-08 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from fAGotRbStYGA0idum... to KNe93cf5wU4xG2d-m... (flutter/flutter#187675)
2026-06-08 engine-flutter-autoroll@skia.org Roll Skia from d17c51db4ede to 0ea3dae686e3 (1 revision) (flutter/flutter#187674)
2026-06-08 engine-flutter-autoroll@skia.org Roll Skia from 9659a87f500f to d17c51db4ede (2 revisions) (flutter/flutter#187672)
2026-06-08 engine-flutter-autoroll@skia.org Roll Skia from a56d5a4e1120 to 9659a87f500f (1 revision) (flutter/flutter#187667)
2026-06-07 engine-flutter-autoroll@skia.org Roll Skia from 101faf7d9d1f to a56d5a4e1120 (1 revision) (flutter/flutter#187665)
2026-06-07 burak.karahan@mail.ru Remove Material import from navigator replacement tests (flutter/flutter#186674)
2026-06-07 burak.karahan@mail.ru Remove Material import from editable text cursor tests (flutter/flutter#186671)
2026-06-07 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from eIU3QDrxaBPAMY9oi... to fAGotRbStYGA0idum... (flutter/flutter#187656)
2026-06-07 engine-flutter-autoroll@skia.org Roll Skia from 294ac0cb2a7d to 101faf7d9d1f (1 revision) (flutter/flutter#187655)
2026-06-06 engine-flutter-autoroll@skia.org Roll Skia from 91ee612cf552 to 294ac0cb2a7d (2 revisions) (flutter/flutter#187651)
2026-06-06 engine-flutter-autoroll@skia.org Roll Skia from a47a9a2c8ae5 to 91ee612cf552 (4 revisions) (flutter/flutter#187642)
2026-06-06 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from N_LiSaBSUsE2LDZgG... to eIU3QDrxaBPAMY9oi... (flutter/flutter#187641)
2026-06-06 engine-flutter-autoroll@skia.org Roll Dart SDK from 05243f181c21 to 73ec2745c49a (2 revisions) (flutter/flutter#187640)
2026-06-06 engine-flutter-autoroll@skia.org Roll Fuchsia GN SDK from oOAcFhkoE2_-Sy67z... to a87CbQSWEjkPUK1ZY... (flutter/flutter#187632)
2026-06-06 engine-flutter-autoroll@skia.org Roll Dart SDK from 6a9a0efe66eb to 05243f181c21 (1 revision) (flutter/flutter#187634)
2026-06-05 bdero@google.com [Flutter GPU] Add instanced draw support (flutter/flutter#187359)
2026-06-05 30870216+gaaclarke@users.noreply.github.com clears out the android context after the frame on mediatek devices (flutter/flutter#187404)
2026-06-05 kevmoo@users.noreply.github.com fix(tool): initialize asset isModified state on startup to prevent 2x hot restart slowdown (flutter/flutter#187488)
2026-06-05 magder@google.com Remove reference to 'good first issue' in the docs (flutter/flutter#187615)
2026-06-05 stuartmorgan@google.com Remove references to 'good first issue' (flutter/flutter#187617)
2026-06-05 154381524+flutteractionsbot@users.noreply.github.com Revert "Add support for stylus buttons" (flutter/flutter#187581)
2026-06-05 6655696+guidezpl@users.noreply.github.com Always run coverage upload step, even if a single test fails (flutter/flutter#187614)

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
navigator replacement widget tests. The tests now use the widgets-only
TestWidgetsApp helper with an explicit PageRouteBuilder for transition
coverage and an explicit HeroController for the Hero assertions.

Validation:
- dart analyze
packages/flutter/test/widgets/navigator_replacement_test.dart
- ./bin/flutter test
packages/flutter/test/widgets/navigator_replacement_test.dart

---------

Co-authored-by: Victor Sanni <victorsanniay@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD f: routes Navigator, Router, and related APIs. framework flutter/packages/flutter repository. See also f: labels.

Projects

Development

Successfully merging this pull request may close these issues.

5 participants