-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Fixed RenderFlex overflow in RouteObserver Example #170980
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Fixed RenderOverflow in RouteObserver Example: https://api.flutter.dev/flutter/widgets/RouteObserver-class.html
|
It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging. If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group. |
victorsanni
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @prash4931, this PR will need a test. Tests for this file can be added in flutter/examples/api/test/widgets/routes/route_observer.0_test.dart.
|
@prash4931 you do not need to merge or rebase every time something is pushed to master. |
Noted |
|
@tirth-patel-nc test cases already exist for this example at flutter/examples/api/test/widgets/routes/route_observer.0_test.dart. Do I need to add more test cases for this? |
yes, as victor mentioned, we’ll need a test for the new change you’ve made. you can prolly add a small overflow test in that same file. |
|
Hi @victorsanni, @tirth-patel-nc I've added the required tests. Please check |
tirth-patel-nc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for contributing 💙
victorsanni
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @prash4931, this PR will need a test to move forward. Thanks!
| addTearDown(tester.binding.window.clearDevicePixelRatioTestValue); | ||
|
|
||
| // Build the RouteObserver example widget. | ||
| await tester.pumpWidget( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is pumping a new MaterialApp. Example tests should test the example itself - in this case, by calling
await tester.pumpWidget(const example.RouteObserverApp());as in the other test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it not possible to test on example.RouteObserverApp()?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got it working with this test:
testWidgets('RouteObserver example renders without overflow on small screens', (
WidgetTester tester,
) async {
// Set the screen size to a smaller value.
tester.binding.window.physicalSizeTestValue = const Size(200, 200);
tester.binding.window.devicePixelRatioTestValue = 1.0;
addTearDown(tester.binding.window.clearPhysicalSizeTestValue);
addTearDown(tester.binding.window.clearDevicePixelRatioTestValue);
// Build the RouteObserver example widget.
await tester.pumpWidget(const example.RouteObserverApp());
await tester.pumpAndSettle();
// Verify there are no layout exceptions.
expect(tester.takeException(), isNull);
});
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @prash4931, this PR is ready to go once this test is replaced with the test in https://github.com/flutter/flutter/pull/170980/files#r2258335551.
| tester.binding.window.physicalSizeTestValue = const Size(300, 600); | ||
| tester.binding.window.devicePixelRatioTestValue = 1.0; | ||
|
|
||
| // Rebuild the widget tree with the new window size. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't rebuild the widget tree with the new window size, it just tells the test framework to restore the window to its original size when the test is done.
|
This pull request executed golden file tests, but it has not been updated in a while (20+ days). Test results from Gold expire after as many days, so this pull request will need to be updated with a fresh commit in order to get results from Gold. For more guidance, visit Writing a golden file test for Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
|
@prash4931 Do you still have plans to finish this PR or should it be closed? |
| // found in the LICENSE file. | ||
|
|
||
| import 'package:flutter_api_samples/widgets/routes/route_observer.0.dart' as example; | ||
| import 'package:flutter_api_samples/widgets/routes/route_observer.0.dart' show RouteObserverExample; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this import needed?
| import 'package:flutter_api_samples/widgets/routes/route_observer.0.dart' as example; | ||
| import 'package:flutter_api_samples/widgets/routes/route_observer.0.dart' show RouteObserverExample; | ||
| import 'package:flutter_test/flutter_test.dart'; | ||
| import 'package:flutter/material.dart'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this import as well
|
@prash4931 FYI you have an analyzer failure here, but we'd love to merge this if you have time to update it! |
|
@victorsanni please review the changes |
victorsanni
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last comment I have is about the added Material import in the test. Is that needed?
|
Hey @prash4931 it looks like this comment needs to be addressed before we can merge this: #170980 (comment) |
|
@prash4931 it looks like only a few merge conflicts are left to resolve, would you like to return to this? |
…10601) Manual roll Flutter from 6a1f5b7f85a4 to e25d71b086d6 (30 revisions) Manual roll requested by [email protected] flutter/flutter@6a1f5b7...e25d71b 2025-12-10 [email protected] Ensure that the engine converts std::filesystem::path objects to UTF-8 strings on Windows (flutter/flutter#179528) 2025-12-10 [email protected] Fix the issue with pinned headers in nested SliverMainAxisGroup. (flutter/flutter#179132) 2025-12-10 [email protected] added onUserInteractionIfError for form (flutter/flutter#175515) 2025-12-10 [email protected] Fixed RenderFlex overflow in RouteObserver Example (flutter/flutter#170980) 2025-12-10 [email protected] Roll Dart SDK from 17749965ec57 to 077062c5e515 (3 revisions) (flutter/flutter#179691) 2025-12-10 [email protected] Manually roll characters (flutter/flutter#179447) 2025-12-10 [email protected] Roll Packages from 338ecd3 to 74a5a53 (4 revisions) (flutter/flutter#179693) 2025-12-10 [email protected] Marks Mac_ios draw_arcs_all_stroke_styles_perf_ios__timeline_summary to be unflaky (flutter/flutter#179669) 2025-12-10 [email protected] Check for a null cached image in SingleFrameCodec::getNextFrame (flutter/flutter#179483) 2025-12-10 [email protected] Roll Fuchsia Linux SDK from _pSztGZvEA3-Ry-GW... to u5vxWTRT0HlxOP5_r... (flutter/flutter#179652) 2025-12-10 [email protected] Implement flutter/accessibility channel (flutter/flutter#179484) 2025-12-10 [email protected] Roll Skia from 82fff05cc621 to e61cc6d073fd (4 revisions) (flutter/flutter#179646) 2025-12-10 [email protected] Make sure that a CupertinoDialogAction doesn't crash in 0x0 environment (flutter/flutter#178956) 2025-12-10 [email protected] Make SettingsChannel configuration queue not static (flutter/flutter#179636) 2025-12-10 [email protected] Make sure that a CupertinoListSection doesn't crash in 0x0 environment (flutter/flutter#179068) 2025-12-10 [email protected] Make sure that a CupertinoFormSection doesn't crash in 0x0 environment (flutter/flutter#179001) 2025-12-10 [email protected] Make sure that a CupertinoMagnifier doesn't crash in 0x0 environment (flutter/flutter#179206) 2025-12-10 [email protected] Make sure that a Tooltip doesn't crash in 0x0 environment (flutter/flutter#178461) 2025-12-10 [email protected] Make sure that a CupertinoSegmentedControl doesn't crash in 0x0 envir… (flutter/flutter#179544) 2025-12-10 [email protected] Make sure that a CupertinoSlider doesn't crash in 0x0 environment (flutter/flutter#179566) 2025-12-10 [email protected] Make sure that a CupertinoPageScaffold doesn't crash in 0x0 environment (flutter/flutter#179245) 2025-12-09 [email protected] Roll Skia from f9e32c28c5c5 to 82fff05cc621 (2 revisions) (flutter/flutter#179641) 2025-12-09 [email protected] Roll Dart SDK from 019cb923bf62 to 17749965ec57 (5 revisions) (flutter/flutter#179640) 2025-12-09 [email protected] Enhance documentation for `LocalHistoryEntry` class (flutter/flutter#179223) 2025-12-09 [email protected] WebParagrah: ellipsis (flutter/flutter#178748) 2025-12-09 [email protected] Update the doc on Google Testing to reflect the current state (flutter/flutter#177187) 2025-12-09 [email protected] [wimp] Initial Impeller on Web implementation. (flutter/flutter#175442) 2025-12-09 [email protected] Relax assertion for adding semantics locale (flutter/flutter#178140) 2025-12-09 [email protected] Fix Scrollbar drag behavior (flutter/flutter#179199) 2025-12-09 [email protected] Roll Skia from 502ee6f2a0d7 to f9e32c28c5c5 (6 revisions) (flutter/flutter#179632) 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 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md ...
Fixed RenderOverflow in RouteObserver Example: https://api.flutter.dev/flutter/widgets/RouteObserver-class.html <!-- Thanks for filing a pull request! Reviewers are typically assigned within a week of filing a request. To learn more about code review, see our documentation on Tree Hygiene: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md --> This PR is about solving render overflow issue in Route Observer Example in Live Website. I've wrapped the body with a Scrollable View to solve this issue | | | | --- | --- | | B |  | | A |  | ## 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]. - [ ] I listed at least one issue that this PR fixes in the description above. - [ ] 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]. - [ ] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. <!-- 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 --------- Co-authored-by: Victor Sanni <[email protected]>
Fixed RenderOverflow in RouteObserver Example: https://api.flutter.dev/flutter/widgets/RouteObserver-class.html
This PR is about solving render overflow issue in Route Observer Example in Live Website. I've wrapped the body with a Scrollable View to solve this issue
Pre-launch Checklist
///).