Remove Material library dependency from expansible_test.dart#181657
Conversation
There was a problem hiding this comment.
Code Review
This pull request is a nice refactoring that removes the unnecessary dependency on the Material library from expansible_test.dart by replacing MaterialApp with WidgetsApp. The changes are correct and well-explained in the description, including the adjustments to coordinate assertions. I have one suggestion to further improve the test file's maintainability by reducing code duplication.
Replace MaterialApp with WidgetsApp in expansible_test.dart to avoid unnecessary Material library imports in widgets-layer tests. - Changed import from 'package:flutter/material.dart' to 'package:flutter/widgets.dart' - Replaced MaterialApp(home: ...) with WidgetsApp(builder: ...) - Updated position assertions to account for the absence of Material scaffold padding (y-coordinates adjusted by -34 pixels)
…xpansible_test.dart Replaced 12 occurrences of the verbose tester.pumpWidget(WidgetsApp(...)) pattern with the simpler pumpTestWidget(tester, ...) call. The "Expansible does not crash at zero area" test was left unchanged since it uses Directionality instead of WidgetsApp (for testing zero-size scenarios).
…up in expansible_test.dart
|
Hey @navaronbracke @victorsanni can I get a review if you have time please? |
navaronbracke
left a comment
There was a problem hiding this comment.
LGTM, but I have to defer to someone else for approval.
justinmc
left a comment
There was a problem hiding this comment.
LGTM 👍. Straightforward. Thanks for helping out with this!
| expect(tester.getBottomLeft(find.byType(Placeholder)).dy, 90.08984375); | ||
| expect(tester.getBottomLeft(find.byType(Placeholder)).dy, 56.08984375); |
There was a problem hiding this comment.
These numbers changed just due to the switch from MaterialApp to TestWidgetsApp?
There was a problem hiding this comment.
Ah I see you explained this above, sounds good.
Roll Flutter from bf701fefec86 to f916dd6887bf (44 revisions) flutter/flutter@bf701fe...f916dd6 2026-02-05 nemeth@marcell.it Implement macOS wide gamut (Display P3) support (flutter/flutter#181769) 2026-02-04 engine-flutter-autoroll@skia.org Roll Skia from d23ecfbfdff9 to 8543ce512d5c (3 revisions) (flutter/flutter#181923) 2026-02-04 engine-flutter-autoroll@skia.org Roll Dart SDK from 8001c99d952b to 8f778ffd318b (3 revisions) (flutter/flutter#181927) 2026-02-04 jason-simmons@users.noreply.github.com Re-enable AddressSanitizer on the linux_unopt builder (flutter/flutter#181741) 2026-02-04 1063596+reidbaker@users.noreply.github.com Add exception to log message in ContentSizingFlag.java (flutter/flutter#181813) 2026-02-04 137456488+flutter-pub-roller-bot@users.noreply.github.com Roll pub packages (flutter/flutter#181925) 2026-02-04 nshahan@google.com [flutter_tools] Deprecate web hot reload flag (flutter/flutter#181884) 2026-02-04 magder@google.com Marks platform_views_scroll_perf_impeller__timeline_summary unflaky (flutter/flutter#181649) 2026-02-04 engine-flutter-autoroll@skia.org Roll Dart SDK from 204db085d970 to 8001c99d952b (1 revision) (flutter/flutter#181902) 2026-02-04 engine-flutter-autoroll@skia.org Roll Skia from f37a22506eb4 to d23ecfbfdff9 (23 revisions) (flutter/flutter#181915) 2026-02-04 jason-simmons@users.noreply.github.com In the Web codec tests, skip an undecodable image that is used to test a Skia error handling code path. (flutter/flutter#181870) 2026-02-04 engine-flutter-autoroll@skia.org Roll Packages from 5b1bea8 to 3bddf2c (5 revisions) (flutter/flutter#181918) 2026-02-04 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from UmQaaNuhkiuE8Dzug... to J2QdLcY2gyt4NP_xV... (flutter/flutter#181893) 2026-02-04 engine-flutter-autoroll@skia.org Roll Dart SDK from 54322a0b1109 to 204db085d970 (3 revisions) (flutter/flutter#181890) 2026-02-04 nurdaulet.97@gmail.com Cleanup cross imports (flutter/flutter#181807) 2026-02-04 kazbek.sultanov.doc@gmail.com [Material] Remove Material import from backdrop_filter_test.dart widget tests (flutter/flutter#181386) 2026-02-04 kazbek.sultanov.doc@gmail.com Move CheckedModeBanner tests to material and remove Material import from widgets banner_test (flutter/flutter#181261) 2026-02-04 git@reb0.org feat: Pass parameters from DropdownMenuFormField to DropDownMenu (flutter/flutter#181373) 2026-02-04 116356835+AbdeMohlbi@users.noreply.github.com Remove `Config complete` log when using `flutter build apk --config-only` (flutter/flutter#181864) 2026-02-04 flar@google.com [Impeller] Fix flattening of very large zoomed curves with tiny stroke widths (flutter/flutter#181505) 2026-02-03 prbillingsley89@gmail.com Propagates Overlay's MediaQueryData to OverlayPortal child (flutter/flutter#181579) 2026-02-03 ahmedsameha1@gmail.com Make sure that an AnimatedScale doesn't crash in 0x0 environment (flutter/flutter#181481) 2026-02-03 engine-flutter-autoroll@skia.org Roll Dart SDK from 56294a92d5cc to 54322a0b1109 (1 revision) (flutter/flutter#181872) 2026-02-03 zemanux@users.noreply.github.com Fix decorated box (flutter/flutter#179802) 2026-02-03 137456488+flutter-pub-roller-bot@users.noreply.github.com Roll pub packages (flutter/flutter#181871) 2026-02-03 70534390+Erengun@users.noreply.github.com Remove Material library dependency from expansible_test.dart (flutter/flutter#181657) 2026-02-03 evanwall@buffalo.edu Organize and update fragment shader uniform tests. (flutter/flutter#181822) 2026-02-03 1961493+harryterkelsen@users.noreply.github.com fix(web_ui): handle non-invertible matrices in ImageFilter.matrix (flutter/flutter#181742) 2026-02-03 nhan13574@gmail.com Remove unnecessary Material import from cupertino/slider_test.dart (flutter/flutter#180957) 2026-02-03 15619084+vashworth@users.noreply.github.com Remove the Flutter.xcframework as a swift dependency (flutter/flutter#181739) 2026-02-03 matt.kosarek@canonical.com feature: implementation of tooltips in the `_TestWindowingOwner` and minor bugfixes to the multiple windows example app (flutter/flutter#181510) 2026-02-03 737941+loic-sharma@users.noreply.github.com [Web] Fix flt-platform-view comment (flutter/flutter#181576) 2026-02-03 fluttergithubbot@gmail.com Marks Linux_pixel_7pro android_verified_input_test to be unflaky (flutter/flutter#179120) 2026-02-03 34871572+gmackall@users.noreply.github.com Unmark `hybrid_android_views_integration_test` as bringup (flutter/flutter#181628) 2026-02-03 brackenavaron@gmail.com Remove material from sliver_tree_test.dart (flutter/flutter#181415) 2026-02-03 34871572+gmackall@users.noreply.github.com Make `android_plugin_new_output_dir_test` only build release (flutter/flutter#181677) 2026-02-03 737941+loic-sharma@users.noreply.github.com Roll customer tests (flutter/flutter#181825) 2026-02-03 41432658+jonathimer@users.noreply.github.com Add Linux Foundation Health Score badge to README (flutter/flutter#175587) 2026-02-03 116356835+AbdeMohlbi@users.noreply.github.com Remove unused getters on AndroidProject class (flutter/flutter#181860) 2026-02-03 47866232+chunhtai@users.noreply.github.com Adds batch release doc for flutter/package (flutter/flutter#181676) 2026-02-03 bkonyi@google.com [ Tool ] Don't use `globals.platform` in `getFlutterRoot()` (flutter/flutter#181859) 2026-02-03 engine-flutter-autoroll@skia.org Roll Packages from 837dbbd to 5b1bea8 (10 revisions) (flutter/flutter#181857) 2026-02-03 brackenavaron@gmail.com Remove material from basic_test.dart (flutter/flutter#181444) 2026-02-03 bkonyi@google.com [ Tool ] Fix regression introduced in flutter/flutter#181421 (flutter/flutter#181826) If this roll has caused a breakage, revert this CL and stop the roller ...
…#181657) This PR removes the unnecessary dependency on the Material library from expansible_test.dart by replacing `MaterialApp` with `WidgetsApp`. Part of flutter#177415 ### Changes 1. **Import change**: Replaced `package:flutter/material.dart` with `package:flutter/widgets.dart` 2. **Widget setup**: Changed from `MaterialApp(home: ...)` to `TestWidgetsApp(home: ...)` - `WidgetsApp` requires either `builder`, `onGenerateRoute`, or `pageRouteBuilder` to be provided If neither builder nor onGenerateRoute are provided, the pageRouteBuilder must be specified so that the default handler will know what kind of PageRoute transition to build. 3. **Updated position assertions**: Since `WidgetsApp` with `builder` doesn't include the default scaffold/status bar padding that `MaterialApp` with `home` provides, the expected y-coordinate values were adjusted by -34 pixels: - `90.08984375` → `56.08984375` - `98.0` → `64.0` - `80.91015625` → `46.91015625` - `48.0` → `14.0` ## 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.
…#181657) This PR removes the unnecessary dependency on the Material library from expansible_test.dart by replacing `MaterialApp` with `WidgetsApp`. Part of flutter#177415 ### Changes 1. **Import change**: Replaced `package:flutter/material.dart` with `package:flutter/widgets.dart` 2. **Widget setup**: Changed from `MaterialApp(home: ...)` to `TestWidgetsApp(home: ...)` - `WidgetsApp` requires either `builder`, `onGenerateRoute`, or `pageRouteBuilder` to be provided If neither builder nor onGenerateRoute are provided, the pageRouteBuilder must be specified so that the default handler will know what kind of PageRoute transition to build. 3. **Updated position assertions**: Since `WidgetsApp` with `builder` doesn't include the default scaffold/status bar padding that `MaterialApp` with `home` provides, the expected y-coordinate values were adjusted by -34 pixels: - `90.08984375` → `56.08984375` - `98.0` → `64.0` - `80.91015625` → `46.91015625` - `48.0` → `14.0` ## 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.
…#181657) This PR removes the unnecessary dependency on the Material library from expansible_test.dart by replacing `MaterialApp` with `WidgetsApp`. Part of flutter#177415 ### Changes 1. **Import change**: Replaced `package:flutter/material.dart` with `package:flutter/widgets.dart` 2. **Widget setup**: Changed from `MaterialApp(home: ...)` to `TestWidgetsApp(home: ...)` - `WidgetsApp` requires either `builder`, `onGenerateRoute`, or `pageRouteBuilder` to be provided If neither builder nor onGenerateRoute are provided, the pageRouteBuilder must be specified so that the default handler will know what kind of PageRoute transition to build. 3. **Updated position assertions**: Since `WidgetsApp` with `builder` doesn't include the default scaffold/status bar padding that `MaterialApp` with `home` provides, the expected y-coordinate values were adjusted by -34 pixels: - `90.08984375` → `56.08984375` - `98.0` → `64.0` - `80.91015625` → `46.91015625` - `48.0` → `14.0` ## 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.
…r#10967) Roll Flutter from bf701fefec86 to f916dd6887bf (44 revisions) flutter/flutter@bf701fe...f916dd6 2026-02-05 nemeth@marcell.it Implement macOS wide gamut (Display P3) support (flutter/flutter#181769) 2026-02-04 engine-flutter-autoroll@skia.org Roll Skia from d23ecfbfdff9 to 8543ce512d5c (3 revisions) (flutter/flutter#181923) 2026-02-04 engine-flutter-autoroll@skia.org Roll Dart SDK from 8001c99d952b to 8f778ffd318b (3 revisions) (flutter/flutter#181927) 2026-02-04 jason-simmons@users.noreply.github.com Re-enable AddressSanitizer on the linux_unopt builder (flutter/flutter#181741) 2026-02-04 1063596+reidbaker@users.noreply.github.com Add exception to log message in ContentSizingFlag.java (flutter/flutter#181813) 2026-02-04 137456488+flutter-pub-roller-bot@users.noreply.github.com Roll pub packages (flutter/flutter#181925) 2026-02-04 nshahan@google.com [flutter_tools] Deprecate web hot reload flag (flutter/flutter#181884) 2026-02-04 magder@google.com Marks platform_views_scroll_perf_impeller__timeline_summary unflaky (flutter/flutter#181649) 2026-02-04 engine-flutter-autoroll@skia.org Roll Dart SDK from 204db085d970 to 8001c99d952b (1 revision) (flutter/flutter#181902) 2026-02-04 engine-flutter-autoroll@skia.org Roll Skia from f37a22506eb4 to d23ecfbfdff9 (23 revisions) (flutter/flutter#181915) 2026-02-04 jason-simmons@users.noreply.github.com In the Web codec tests, skip an undecodable image that is used to test a Skia error handling code path. (flutter/flutter#181870) 2026-02-04 engine-flutter-autoroll@skia.org Roll Packages from 5b1bea8 to 3bddf2c (5 revisions) (flutter/flutter#181918) 2026-02-04 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from UmQaaNuhkiuE8Dzug... to J2QdLcY2gyt4NP_xV... (flutter/flutter#181893) 2026-02-04 engine-flutter-autoroll@skia.org Roll Dart SDK from 54322a0b1109 to 204db085d970 (3 revisions) (flutter/flutter#181890) 2026-02-04 nurdaulet.97@gmail.com Cleanup cross imports (flutter/flutter#181807) 2026-02-04 kazbek.sultanov.doc@gmail.com [Material] Remove Material import from backdrop_filter_test.dart widget tests (flutter/flutter#181386) 2026-02-04 kazbek.sultanov.doc@gmail.com Move CheckedModeBanner tests to material and remove Material import from widgets banner_test (flutter/flutter#181261) 2026-02-04 git@reb0.org feat: Pass parameters from DropdownMenuFormField to DropDownMenu (flutter/flutter#181373) 2026-02-04 116356835+AbdeMohlbi@users.noreply.github.com Remove `Config complete` log when using `flutter build apk --config-only` (flutter/flutter#181864) 2026-02-04 flar@google.com [Impeller] Fix flattening of very large zoomed curves with tiny stroke widths (flutter/flutter#181505) 2026-02-03 prbillingsley89@gmail.com Propagates Overlay's MediaQueryData to OverlayPortal child (flutter/flutter#181579) 2026-02-03 ahmedsameha1@gmail.com Make sure that an AnimatedScale doesn't crash in 0x0 environment (flutter/flutter#181481) 2026-02-03 engine-flutter-autoroll@skia.org Roll Dart SDK from 56294a92d5cc to 54322a0b1109 (1 revision) (flutter/flutter#181872) 2026-02-03 zemanux@users.noreply.github.com Fix decorated box (flutter/flutter#179802) 2026-02-03 137456488+flutter-pub-roller-bot@users.noreply.github.com Roll pub packages (flutter/flutter#181871) 2026-02-03 70534390+Erengun@users.noreply.github.com Remove Material library dependency from expansible_test.dart (flutter/flutter#181657) 2026-02-03 evanwall@buffalo.edu Organize and update fragment shader uniform tests. (flutter/flutter#181822) 2026-02-03 1961493+harryterkelsen@users.noreply.github.com fix(web_ui): handle non-invertible matrices in ImageFilter.matrix (flutter/flutter#181742) 2026-02-03 nhan13574@gmail.com Remove unnecessary Material import from cupertino/slider_test.dart (flutter/flutter#180957) 2026-02-03 15619084+vashworth@users.noreply.github.com Remove the Flutter.xcframework as a swift dependency (flutter/flutter#181739) 2026-02-03 matt.kosarek@canonical.com feature: implementation of tooltips in the `_TestWindowingOwner` and minor bugfixes to the multiple windows example app (flutter/flutter#181510) 2026-02-03 737941+loic-sharma@users.noreply.github.com [Web] Fix flt-platform-view comment (flutter/flutter#181576) 2026-02-03 fluttergithubbot@gmail.com Marks Linux_pixel_7pro android_verified_input_test to be unflaky (flutter/flutter#179120) 2026-02-03 34871572+gmackall@users.noreply.github.com Unmark `hybrid_android_views_integration_test` as bringup (flutter/flutter#181628) 2026-02-03 brackenavaron@gmail.com Remove material from sliver_tree_test.dart (flutter/flutter#181415) 2026-02-03 34871572+gmackall@users.noreply.github.com Make `android_plugin_new_output_dir_test` only build release (flutter/flutter#181677) 2026-02-03 737941+loic-sharma@users.noreply.github.com Roll customer tests (flutter/flutter#181825) 2026-02-03 41432658+jonathimer@users.noreply.github.com Add Linux Foundation Health Score badge to README (flutter/flutter#175587) 2026-02-03 116356835+AbdeMohlbi@users.noreply.github.com Remove unused getters on AndroidProject class (flutter/flutter#181860) 2026-02-03 47866232+chunhtai@users.noreply.github.com Adds batch release doc for flutter/package (flutter/flutter#181676) 2026-02-03 bkonyi@google.com [ Tool ] Don't use `globals.platform` in `getFlutterRoot()` (flutter/flutter#181859) 2026-02-03 engine-flutter-autoroll@skia.org Roll Packages from 837dbbd to 5b1bea8 (10 revisions) (flutter/flutter#181857) 2026-02-03 brackenavaron@gmail.com Remove material from basic_test.dart (flutter/flutter#181444) 2026-02-03 bkonyi@google.com [ Tool ] Fix regression introduced in flutter/flutter#181421 (flutter/flutter#181826) If this roll has caused a breakage, revert this CL and stop the roller ...
This PR removes the unnecessary dependency on the Material library from expansible_test.dart by replacing
MaterialAppwithWidgetsApp.Part of #177415
Changes
Import change: Replaced
package:flutter/material.dartwithpackage:flutter/widgets.dartWidget setup: Changed from
MaterialApp(home: ...)toTestWidgetsApp(home: ...)WidgetsApprequires eitherbuilder,onGenerateRoute, orpageRouteBuilderto be providedIf neither builder nor onGenerateRoute are provided, the pageRouteBuilder must be specified so that the default handler will know what kind of PageRoute transition to build.
Updated position assertions: Since
WidgetsAppwithbuilderdoesn't include the default scaffold/status bar padding thatMaterialAppwithhomeprovides, the expected y-coordinate values were adjusted by -34 pixels:90.08984375→56.0898437598.0→64.080.91015625→46.9101562548.0→14.0Pre-launch Checklist
///).