Skip to content

Conversation

@prash4931
Copy link
Contributor

@prash4931 prash4931 commented Jun 22, 2025

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

B image
A image

Pre-launch Checklist

@flutter-dashboard
Copy link

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.

@github-actions github-actions bot added framework flutter/packages/flutter repository. See also f: labels. d: api docs Issues with https://api.flutter.dev/ d: examples Sample code and demos f: routes Navigator, Router, and related APIs. labels Jun 22, 2025
@justinmc justinmc requested a review from victorsanni June 24, 2025 22:10
Copy link
Contributor

@victorsanni victorsanni left a 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.

@tirth-patel-nc
Copy link
Member

@prash4931 you do not need to merge or rebase every time something is pushed to master.

@prash4931
Copy link
Contributor Author

prash4931 commented Jun 27, 2025

@prash4931 you do not need to merge or rebase every time something is pushed to master.

Noted

@prash4931
Copy link
Contributor Author

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

@tirth-patel-nc
Copy link
Member

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

expect(tester.takeException(), isNull);

@prash4931 prash4931 requested a review from tirth-patel-nc June 27, 2025 10:54
@prash4931
Copy link
Contributor Author

Hi @victorsanni, @tirth-patel-nc I've added the required tests. Please check

@prash4931 prash4931 requested a review from victorsanni June 27, 2025 10:55
Copy link
Member

@tirth-patel-nc tirth-patel-nc left a 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 💙

Copy link
Contributor

@victorsanni victorsanni left a 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(
Copy link
Contributor

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.

Copy link
Contributor

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()?

Copy link
Contributor

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);
  });

Copy link
Contributor

Choose a reason for hiding this comment

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

tester.binding.window.physicalSizeTestValue = const Size(300, 600);
tester.binding.window.devicePixelRatioTestValue = 1.0;

// Rebuild the widget tree with the new window size.
Copy link
Contributor

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.

@flutter-dashboard
Copy link

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 package:flutter.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@justinmc
Copy link
Contributor

@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;
Copy link
Contributor

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';
Copy link
Contributor

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

@justinmc
Copy link
Contributor

@prash4931 FYI you have an analyzer failure here, but we'd love to merge this if you have time to update it!

@prash4931
Copy link
Contributor Author

@victorsanni please review the changes

Copy link
Contributor

@victorsanni victorsanni left a 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?

@Piinks
Copy link
Contributor

Piinks commented Nov 11, 2025

Hey @prash4931 it looks like this comment needs to be addressed before we can merge this: #170980 (comment)

@Piinks
Copy link
Contributor

Piinks commented Dec 9, 2025

@prash4931 it looks like only a few merge conflicts are left to resolve, would you like to return to this?

@victorsanni victorsanni added the autosubmit Merge PR when tree becomes green via auto submit App label Dec 10, 2025
@auto-submit auto-submit bot added this pull request to the merge queue Dec 10, 2025
Merged via the queue into flutter:master with commit 2c4e7eb Dec 10, 2025
44 checks passed
@flutter-dashboard flutter-dashboard bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Dec 10, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 10, 2025
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Dec 10, 2025
…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
...
Mairramer pushed a commit to Mairramer/flutter that referenced this pull request Dec 11, 2025
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 |
![image](https://github.com/user-attachments/assets/c8fa78e7-62ca-4bd1-9798-588c636cd61a)
|
| A |
![image](https://github.com/user-attachments/assets/3a2b4697-121a-43e3-9c85-b1379a575af1)
|

## 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

d: api docs Issues with https://api.flutter.dev/ d: examples Sample code and demos f: routes Navigator, Router, and related APIs. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants