Skip to content

Conversation

@goderbauer
Copy link
Member

@goderbauer goderbauer commented Jan 3, 2024

This reverts commit d24c01b.

The original change was reverted because it caused some apps to get stuck on the splash screen on some phones.

An investigation determined that this was due to a rounding error. Example: The device reports a physical size of 1008.0 x 2198.0 with a dpr of 1.912500023841858. Flutter would translate that to a logical size of 527.0588169589221 x 1149.2810314243163 and use that as the input for its layout algorithm. Since the constraints here are tight, the layout algorithm would determine that the resulting logical size of the root render object must be 527.0588169589221 x 1149.2810314243163. Translating this back to physical pixels by applying the dpr resulted in a physical size of 1007.9999999999999 x 2198.0 for the frame. Android now rejected that frame because it didn't match the expected size of 1008.0 x 2198.0 and since no frame had been rendered would never take down the splash screen.

Prior to dynamically sized views, this wasn't an issue because we would hard-code the frame size to whatever the requested size was.

Changes in this PR over the original PR:

  • The issue has been fixed now by constraining the calculated physical size to the input physical constraints which makes sure that we always end up with a size that is acceptable to the operating system.
  • The ViewConfiguration was refactored to use the slightly more convenient BoxConstraints over the ViewConstraints to represent constraints. Both essentially represent the same thing, but BoxConstraints are more powerful and we avoid a couple of translations between the two by translating the ViewConstraints from the FlutterView to BoxConstraints directly when the ViewConfiguration is created.

All changes over the original PR are contained in the second commit of this PR.

Fixes b/316813075
Part of #134501.

@github-actions github-actions bot added a: tests "flutter test", flutter_test, or one of our tests framework flutter/packages/flutter repository. See also f: labels. labels Jan 3, 2024
@goderbauer goderbauer marked this pull request as ready for review January 3, 2024 21:36
@goderbauer
Copy link
Member Author

FYI @jiahaog @chingjun @ditman

Copy link
Contributor

Choose a reason for hiding this comment

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

Why no leak tracking?

Copy link
Member Author

Choose a reason for hiding this comment

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

Between reverting and relanding this change the testWidgetsWithLeakTracking method was removed in #140239. It's functionality is now folded into testWidgets directly.

Copy link
Contributor

Choose a reason for hiding this comment

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

If the ViewConfiguration doesn't use ViewConstraints anymore, do we need the distinction still? It doesn't appear to be used anywhere in the framework (although it is used in the engine).

Copy link
Member Author

@goderbauer goderbauer Jan 3, 2024

Choose a reason for hiding this comment

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

We still need it for the type used by FlutterView.physicalConstraints in the engine since the engine doesn't have access to the BoxConstraints type. This is similar to how the engine uses ViewPadding that the framework then translates to EdgeInsets at its earliest convenience because the second one is more powerful.

Copy link
Contributor

@gspencergoog gspencergoog left a comment

Choose a reason for hiding this comment

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

32384589-a60f0e74-c078-11e7-9bc1-e5b5287aea9d

@goderbauer
Copy link
Member Author

Waiting for confirmation on b/316813075 before merging this.

@goderbauer goderbauer added the autosubmit Merge PR when tree becomes green via auto submit App label Jan 9, 2024
@goderbauer goderbauer merged commit 4534a24 into flutter:master Jan 9, 2024
@goderbauer goderbauer deleted the dynamicView2 branch January 9, 2024 22:10
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 10, 2024
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Jan 10, 2024
flutter/flutter@126302d...b840a60

2024-01-10 [email protected] Roll Flutter Engine from 3269fd84460d to b361a60ae224 (1 revision) (flutter/flutter#141271)
2024-01-10 [email protected] Roll Flutter Engine from a5d446da5495 to 3269fd84460d (1 revision) (flutter/flutter#141264)
2024-01-10 [email protected] Roll Flutter Engine from 3ccf66bed335 to a5d446da5495 (2 revisions) (flutter/flutter#141252)
2024-01-10 [email protected] Roll Flutter Engine from e57e418c02ae to 3ccf66bed335 (1 revision) (flutter/flutter#141241)
2024-01-10 [email protected] Roll Flutter Engine from 7e6f3d847e01 to e57e418c02ae (1 revision) (flutter/flutter#141240)
2024-01-10 [email protected] Roll Flutter Engine from 1cf2e0a603c7 to 7e6f3d847e01 (1 revision) (flutter/flutter#141237)
2024-01-10 [email protected] Roll Flutter Engine from 32bbf8be8d2c to 1cf2e0a603c7 (1 revision) (flutter/flutter#141232)
2024-01-10 [email protected] Roll Flutter Engine from 5b9d2132b7cd to 32bbf8be8d2c (1 revision) (flutter/flutter#141229)
2024-01-10 [email protected] Roll Flutter Engine from 941f268fc8bb to 5b9d2132b7cd (1 revision) (flutter/flutter#141228)
2024-01-10 [email protected] Roll Flutter Engine from 542fea9edae4 to 941f268fc8bb (3 revisions) (flutter/flutter#141224)
2024-01-10 [email protected] `NestedScrollView`'s outer scrollable jumping with `BouncingScrollPhysics` due to `double` precision errors (flutter/flutter#138319)
2024-01-10 [email protected] Roll Flutter Engine from 8c1501f3956d to 542fea9edae4 (1 revision) (flutter/flutter#141217)
2024-01-10 [email protected] Fix or except leaks. (flutter/flutter#141081)
2024-01-09 [email protected] Roll Flutter Engine from 693af0c699c5 to 8c1501f3956d (1 revision) (flutter/flutter#141215)
2024-01-09 [email protected] TextStyle: In copyWith, stop ignoring debugLabel when receiver has none (flutter/flutter#141141)
2024-01-09 [email protected] Roll Flutter Engine from a35e3b026e1d to 693af0c699c5 (5 revisions) (flutter/flutter#141209)
2024-01-09 [email protected] Replace deprecated `exists` in podhelper.rb (flutter/flutter#141169)
2024-01-09 [email protected] Correctly handle null case in ProcessText.queryTextActions (flutter/flutter#141205)
2024-01-09 [email protected] Add environment variable to leak tracking bots. (flutter/flutter#141137)
2024-01-09 [email protected] Reapply "Dynamic view sizing" (#140165) (flutter/flutter#140918)
2024-01-09 [email protected] Introduce new Form validation method  (flutter/flutter#135578)
2024-01-09 [email protected] Update `RouteObserver` example and fix an error thrown (flutter/flutter#141166)
2024-01-09 [email protected] Upgrade leak_tracker. (flutter/flutter#141153)
2024-01-09 [email protected] [ci.yaml] Do not run packaging test on presubmit (flutter/flutter#141192)
2024-01-09 [email protected] Roll Flutter Engine from 036b39fa47fa to a35e3b026e1d (6 revisions) (flutter/flutter#141191)
2024-01-09 [email protected] Run tests on iOS 16 or iOS 17 (flutter/flutter#141178)
2024-01-09 [email protected] Remove conditions that depend on order. (flutter/flutter#141183)
2024-01-09 [email protected] Roll Flutter Engine from b3c8597df0e2 to 036b39fa47fa (1 revision) (flutter/flutter#141179)
2024-01-09 [email protected] resolved the issue of indeterminate CircularProgressIndicator.adaptive on Darwin  (flutter/flutter#140947)

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],[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
cbracken added a commit to cbracken/flutter that referenced this pull request May 20, 2025
This enables support for dynamic view resizing in non-web embedders.
While this patch enables support for dynamic view resizing in non-web
embedders, it does not *implement* support in any embedder.

When Flutter applications call `FlutterView.render` with a non-null
`size` parameter, the size will be compared to the existing view size
(if any), and if different, a call to `PlatformView::ResizeView` will be
triggered. Embedders can respond to this call by resizing the underlying
platform-specific FlutterView to the appropriate size.

Related patches:
* `dart:ui`: flutter/engine#48090
* framework: flutter#138648
* framework reland: flutter#140918
* Web: flutter/engine#50271

Issue: flutter#169147
Issue: flutter#149033
cbracken added a commit to cbracken/flutter that referenced this pull request May 21, 2025
This enables support for dynamic view resizing in non-web embedders.
While this patch enables support for dynamic view resizing in non-web
embedders, it does not *implement* support in any embedder.

When Flutter applications call `FlutterView.render` with a non-null
`size` parameter, the size will be compared to the existing view size
(if any), and if different, a call to `PlatformView::ResizeView` will be
triggered. Embedders can respond to this call by resizing the underlying
platform-specific FlutterView to the appropriate size.

Extracts a resize_view_callback to the embedder API that custom
embedders can register to receive the updated size from the engine, and
adapt their views accordingly.

Related patches:
* `dart:ui`: flutter/engine#48090
* framework: flutter#138648
* framework reland: flutter#140918
* Web: flutter/engine#50271

Issue: flutter#169147
Issue: flutter#149033
cbracken added a commit to cbracken/flutter that referenced this pull request May 27, 2025
This enables support for dynamic view resizing in non-web embedders.
While this patch enables support for dynamic view resizing in non-web
embedders, it does not *implement* support in any embedder.

When Flutter applications call `FlutterView.render` with a non-null
`size` parameter, the size will be compared to the existing view size
(if any), and if different, a call to `PlatformView::ResizeView` will be
triggered. Embedders can respond to this call by resizing the underlying
platform-specific FlutterView to the appropriate size.

Extracts a resize_view_callback to the embedder API that custom
embedders can register to receive the updated size from the engine, and
adapt their views accordingly.

Related patches:
* `dart:ui`: flutter/engine#48090
* framework: flutter#138648
* framework reland: flutter#140918
* Web: flutter/engine#50271

Issue: flutter#169147
Issue: flutter#149033
cbracken added a commit to cbracken/flutter that referenced this pull request May 27, 2025
This enables support for dynamic view resizing in non-web embedders.
While this patch enables support for dynamic view resizing in non-web
embedders, it does not *implement* support in any embedder.

When Flutter applications call `FlutterView.render` with a non-null
`size` parameter, the size will be compared to the existing view size
(if any), and if different, a call to `PlatformView::ResizeView` will be
triggered. Embedders can respond to this call by resizing the underlying
platform-specific FlutterView to the appropriate size.

Extracts a resize_view_callback to the embedder API that custom
embedders can register to receive the updated size from the engine, and
adapt their views accordingly.

Related patches:
* `dart:ui`: flutter/engine#48090
* framework: flutter#138648
* framework reland: flutter#140918
* Web: flutter/engine#50271

Issue: flutter#169147
Issue: flutter#149033
cbracken added a commit to cbracken/flutter that referenced this pull request May 27, 2025
This enables support for dynamic view resizing in non-web embedders.
While this patch enables support and exposes API for dynamic view
resizing in non-web embedders and in the embedder API, it does not
*implement* support in any embedder.

This feature is restricted to embedders with merged UI and platform
thread due to the need to inform the embedder of the updated view size
synchronously with presenting the content. With some effort, we could
implement synchronisation logic that supports non-thread-merged
embedders. See ResizeSynchronizer in the macOS embedder for details of
what's involved.

When Flutter applications call `FlutterView.render` with a non-null
`size` parameter, the size will be compared to the existing view size
(if any), and if different, a call to `PlatformView::ResizeView` will be
triggered. Embedders can respond to this call by resizing the underlying
platform-specific FlutterView to the appropriate size.

Extracts a resize_view_callback to the embedder API that custom
embedders can register to receive the updated size from the engine, and
adapt their views accordingly.

Related patches:
* `dart:ui`: flutter/engine#48090
* framework: flutter#138648
* framework reland: flutter#140918
* Web: flutter/engine#50271

Issue: flutter#169147
Issue: flutter#149033
cbracken added a commit to cbracken/flutter that referenced this pull request May 28, 2025
This enables support for dynamic view resizing in non-web embedders.
While this patch enables support and exposes API for dynamic view
resizing in non-web embedders and in the embedder API, it does not
*implement* support in any embedder.

This feature is restricted to embedders with merged UI and platform
thread due to the need to inform the embedder of the updated view size
synchronously with presenting the content. With some effort, we could
implement synchronisation logic that supports non-thread-merged
embedders. See ResizeSynchronizer in the macOS embedder for details of
what's involved.

When Flutter applications call `FlutterView.render` with a non-null
`size` parameter, the size will be compared to the existing view size
(if any), and if different, a call to `PlatformView::ResizeView` will be
triggered. Embedders can respond to this call by resizing the underlying
platform-specific FlutterView to the appropriate size.

Extracts a resize_view_callback to the embedder API that custom
embedders can register to receive the updated size from the engine, and
adapt their views accordingly.

Related patches:
* `dart:ui`: flutter/engine#48090
* framework: flutter#138648
* framework reland: flutter#140918
* Web: flutter/engine#50271

Issue: flutter#169147
Issue: flutter#149033
cbracken added a commit to cbracken/flutter that referenced this pull request May 28, 2025
This enables support for dynamic view resizing in non-web embedders.
While this patch enables support and exposes API for dynamic view
resizing in non-web embedders and in the embedder API, it does not
*implement* support in any embedder.

This feature is restricted to embedders with merged UI and platform
thread due to the need to inform the embedder of the updated view size
synchronously with presenting the content. With some effort, we could
implement synchronisation logic that supports non-thread-merged
embedders. See ResizeSynchronizer in the macOS embedder for details of
what's involved.

When Flutter applications call `FlutterView.render` with a non-null
`size` parameter, the size will be compared to the existing view size
(if any), and if different, a call to `PlatformView::ResizeView` will be
triggered. Embedders can respond to this call by resizing the underlying
platform-specific FlutterView to the appropriate size.

Extracts a resize_view_callback to the embedder API that custom
embedders can register to receive the updated size from the engine, and
adapt their views accordingly.

Related patches:
* `dart:ui`: flutter/engine#48090
* framework: flutter#138648
* framework reland: flutter#140918
* Web: flutter/engine#50271

Issue: flutter#169147
Issue: flutter#149033
cbracken added a commit to cbracken/flutter that referenced this pull request May 28, 2025
This enables support for dynamic view resizing in non-web embedders.
While this patch enables support and exposes API for dynamic view
resizing in non-web embedders and in the embedder API, it does not
*implement* support in any embedder.

This feature is restricted to embedders with merged UI and platform
thread due to the need to inform the embedder of the updated view size
synchronously with presenting the content. With some effort, we could
implement synchronisation logic that supports non-thread-merged
embedders. See ResizeSynchronizer in the macOS embedder for details of
what's involved.

When Flutter applications call `FlutterView.render` with a non-null
`size` parameter, the size will be compared to the existing view size
(if any), and if different, a call to `PlatformView::ResizeView` will be
triggered. Embedders can respond to this call by resizing the underlying
platform-specific FlutterView to the appropriate size.

Extracts a resize_view_callback to the embedder API that custom
embedders can register to receive the updated size from the engine, and
adapt their views accordingly.

Related patches:
* `dart:ui`: flutter/engine#48090
* framework: flutter#138648
* framework reland: flutter#140918
* Web: flutter/engine#50271

Issue: flutter#169147
Issue: flutter#149033
cbracken added a commit to cbracken/flutter that referenced this pull request May 28, 2025
This enables support for dynamic view resizing in non-web embedders.
While this patch enables support and exposes API for dynamic view
resizing in non-web embedders and in the embedder API, it does not
*implement* support in any embedder.

This feature is restricted to embedders with merged UI and platform
thread due to the need to inform the embedder of the updated view size
synchronously with presenting the content. With some effort, we could
implement synchronisation logic that supports non-thread-merged
embedders. See ResizeSynchronizer in the macOS embedder for details of
what's involved.

When Flutter applications call `FlutterView.render` with a non-null
`size` parameter, the size will be compared to the existing view size
(if any), and if different, a call to `PlatformView::ResizeView` will be
triggered. Embedders can respond to this call by resizing the underlying
platform-specific FlutterView to the appropriate size.

Extracts a resize_view_callback to the embedder API that custom
embedders can register to receive the updated size from the engine, and
adapt their views accordingly.

Related patches:
* `dart:ui`: flutter/engine#48090
* framework: flutter#138648
* framework reland: flutter#140918
* Web: flutter/engine#50271

Issue: flutter#169147
Issue: flutter#149033
cbracken added a commit to cbracken/flutter that referenced this pull request May 29, 2025
This enables support for dynamic view resizing in non-web embedders.
While this patch enables support and exposes API for dynamic view
resizing in non-web embedders and in the embedder API, it does not
*implement* support in any embedder.

This feature is restricted to embedders with merged UI and platform
thread due to the need to inform the embedder of the updated view size
synchronously with presenting the content. With some effort, we could
implement synchronisation logic that supports non-thread-merged
embedders. See ResizeSynchronizer in the macOS embedder for details of
what's involved.

When Flutter applications call `FlutterView.render` with a non-null
`size` parameter, the size will be compared to the existing view size
(if any), and if different, a call to `PlatformView::ResizeView` will be
triggered. Embedders can respond to this call by resizing the underlying
platform-specific FlutterView to the appropriate size.

Extracts a resize_view_callback to the embedder API that custom
embedders can register to receive the updated size from the engine, and
adapt their views accordingly.

Related patches:
* `dart:ui`: flutter/engine#48090
* framework: flutter#138648
* framework reland: flutter#140918
* Web: flutter/engine#50271

Issue: flutter#169147
Issue: flutter#149033
cbracken added a commit to cbracken/flutter that referenced this pull request May 29, 2025
This enables support for dynamic view resizing in non-web embedders.
While this patch enables support and exposes API for dynamic view
resizing in non-web embedders and in the embedder API, it does not
*implement* support in any embedder.

This feature is restricted to embedders with merged UI and platform
thread due to the need to inform the embedder of the updated view size
synchronously with presenting the content. With some effort, we could
implement synchronisation logic that supports non-thread-merged
embedders. See ResizeSynchronizer in the macOS embedder for details of
what's involved.

When Flutter applications call `FlutterView.render` with a non-null
`size` parameter, the size will be compared to the existing view size
(if any), and if different, a call to `PlatformView::ResizeView` will be
triggered. Embedders can respond to this call by resizing the underlying
platform-specific FlutterView to the appropriate size.

Extracts a resize_view_callback to the embedder API that custom
embedders can register to receive the updated size from the engine, and
adapt their views accordingly.

Related patches:
* `dart:ui`: flutter/engine#48090
* framework: flutter#138648
* framework reland: flutter#140918
* Web: flutter/engine#50271

Issue: flutter#169147
Issue: flutter#149033
cbracken added a commit to cbracken/flutter that referenced this pull request Jun 12, 2025
This enables support for dynamic view resizing in non-web embedders.
While this patch enables support and exposes API for dynamic view
resizing in non-web embedders and in the embedder API, it does not
*implement* support in any embedder.

This feature is restricted to embedders with merged UI and platform
thread due to the need to inform the embedder of the updated view size
synchronously with presenting the content. With some effort, we could
implement synchronisation logic that supports non-thread-merged
embedders. See ResizeSynchronizer in the macOS embedder for details of
what's involved.

When Flutter applications call `FlutterView.render` with a non-null
`size` parameter, the size will be compared to the existing view size
(if any), and if different, a call to `PlatformView::ResizeView` will be
triggered. Embedders can respond to this call by resizing the underlying
platform-specific FlutterView to the appropriate size.

Extracts a resize_view_callback to the embedder API that custom
embedders can register to receive the updated size from the engine, and
adapt their views accordingly.

Related patches:
* `dart:ui`: flutter/engine#48090
* framework: flutter#138648
* framework reland: flutter#140918
* Web: flutter/engine#50271

Issue: flutter#169147
Issue: flutter#149033
cbracken added a commit to cbracken/flutter that referenced this pull request Jun 12, 2025
This enables support for dynamic view resizing in non-web embedders.
While this patch enables support and exposes API for dynamic view
resizing in non-web embedders and in the embedder API, it does not
*implement* support in any embedder.

This feature is restricted to embedders with merged UI and platform
thread due to the need to inform the embedder of the updated view size
synchronously with presenting the content. With some effort, we could
implement synchronisation logic that supports non-thread-merged
embedders. See ResizeSynchronizer in the macOS embedder for details of
what's involved.

When Flutter applications call `FlutterView.render` with a non-null
`size` parameter, the size will be compared to the existing view size
(if any), and if different, a call to `PlatformView::ResizeView` will be
triggered. Embedders can respond to this call by resizing the underlying
platform-specific FlutterView to the appropriate size.

Extracts a resize_view_callback to the embedder API that custom
embedders can register to receive the updated size from the engine, and
adapt their views accordingly.

Related patches:
* `dart:ui`: flutter/engine#48090
* framework: flutter#138648
* framework reland: flutter#140918
* Web: flutter/engine#50271

Issue: flutter#169147
Issue: flutter#149033
cbracken added a commit to cbracken/flutter that referenced this pull request Jun 12, 2025
This enables support for dynamic view resizing in non-web embedders.
While this patch enables support and exposes API for dynamic view
resizing in non-web embedders and in the embedder API, it does not
*implement* support in any embedder.

This feature is restricted to embedders with merged UI and platform
thread due to the need to inform the embedder of the updated view size
synchronously with presenting the content. With some effort, we could
implement synchronisation logic that supports non-thread-merged
embedders. See ResizeSynchronizer in the macOS embedder for details of
what's involved.

When Flutter applications call `FlutterView.render` with a non-null
`size` parameter, the size will be compared to the existing view size
(if any), and if different, a call to `PlatformView::ResizeView` will be
triggered. Embedders can respond to this call by resizing the underlying
platform-specific FlutterView to the appropriate size.

Extracts a resize_view_callback to the embedder API that custom
embedders can register to receive the updated size from the engine, and
adapt their views accordingly.

Related patches:
* `dart:ui`: flutter/engine#48090
* framework: flutter#138648
* framework reland: flutter#140918
* Web: flutter/engine#50271

Issue: flutter#169147
Issue: flutter#149033
cbracken added a commit to cbracken/flutter that referenced this pull request Jun 12, 2025
This enables support for dynamic view resizing in non-web embedders.
While this patch enables support and exposes API for dynamic view
resizing in non-web embedders and in the embedder API, it does not
*implement* support in any embedder.

This feature is restricted to embedders with merged UI and platform
thread due to the need to inform the embedder of the updated view size
synchronously with presenting the content. With some effort, we could
implement synchronisation logic that supports non-thread-merged
embedders. See ResizeSynchronizer in the macOS embedder for details of
what's involved.

When Flutter applications call `FlutterView.render` with a non-null
`size` parameter, the size will be compared to the existing view size
(if any), and if different, a call to `PlatformView::ResizeView` will be
triggered. Embedders can respond to this call by resizing the underlying
platform-specific FlutterView to the appropriate size.

Extracts a resize_view_callback to the embedder API that custom
embedders can register to receive the updated size from the engine, and
adapt their views accordingly.

Related patches:
* `dart:ui`: flutter/engine#48090
* framework: flutter#138648
* framework reland: flutter#140918
* Web: flutter/engine#50271

Issue: flutter#169147
Issue: flutter#149033
cbracken added a commit to cbracken/flutter that referenced this pull request Jun 12, 2025
This enables support for dynamic view resizing in non-web embedders.
While this patch enables support and exposes API for dynamic view
resizing in non-web embedders and in the embedder API, it does not
*implement* support in any embedder.

This feature is restricted to embedders with merged UI and platform
thread due to the need to inform the embedder of the updated view size
synchronously with presenting the content. With some effort, we could
implement synchronisation logic that supports non-thread-merged
embedders. See ResizeSynchronizer in the macOS embedder for details of
what's involved.

When Flutter applications call `FlutterView.render` with a non-null
`size` parameter, the size will be compared to the existing view size
(if any), and if different, a call to `PlatformView::ResizeView` will be
triggered. Embedders can respond to this call by resizing the underlying
platform-specific FlutterView to the appropriate size.

Extracts a resize_view_callback to the embedder API that custom
embedders can register to receive the updated size from the engine, and
adapt their views accordingly.

Related patches:
* `dart:ui`: flutter/engine#48090
* framework: flutter#138648
* framework reland: flutter#140918
* Web: flutter/engine#50271

Issue: flutter#169147
Issue: flutter#149033
cbracken added a commit to cbracken/flutter that referenced this pull request Jun 12, 2025
This enables support for dynamic view resizing in non-web embedders.
While this patch enables support and exposes API for dynamic view
resizing in non-web embedders and in the embedder API, it does not
*implement* support in any embedder.

This feature is restricted to embedders with merged UI and platform
thread due to the need to inform the embedder of the updated view size
synchronously with presenting the content. With some effort, we could
implement synchronisation logic that supports non-thread-merged
embedders. See ResizeSynchronizer in the macOS embedder for details of
what's involved.

When Flutter applications call `FlutterView.render` with a non-null
`size` parameter, the size will be compared to the existing view size
(if any), and if different, a call to `PlatformView::ResizeView` will be
triggered. Embedders can respond to this call by resizing the underlying
platform-specific FlutterView to the appropriate size.

Extracts a resize_view_callback to the embedder API that custom
embedders can register to receive the updated size from the engine, and
adapt their views accordingly.

Related patches:
* `dart:ui`: flutter/engine#48090
* framework: flutter#138648
* framework reland: flutter#140918
* Web: flutter/engine#50271

Issue: flutter#169147
Issue: flutter#149033
mboetger pushed a commit to mboetger/flutter that referenced this pull request Jul 21, 2025
This enables support for dynamic view resizing in non-web embedders.
While this patch enables support and exposes API for dynamic view
resizing in non-web embedders and in the embedder API, it does not
*implement* support in any embedder.

This feature is restricted to embedders with merged UI and platform
thread due to the need to inform the embedder of the updated view size
synchronously with presenting the content. With some effort, we could
implement synchronisation logic that supports non-thread-merged
embedders. See ResizeSynchronizer in the macOS embedder for details of
what's involved.

When Flutter applications call `FlutterView.render` with a non-null
`size` parameter, the size will be compared to the existing view size
(if any), and if different, a call to `PlatformView::ResizeView` will be
triggered. Embedders can respond to this call by resizing the underlying
platform-specific FlutterView to the appropriate size.

Extracts a resize_view_callback to the embedder API that custom
embedders can register to receive the updated size from the engine, and
adapt their views accordingly.

Related patches:
* `dart:ui`: flutter/engine#48090
* framework: flutter#138648
* framework reland: flutter#140918
* Web: flutter/engine#50271

Issue: flutter#169147
Issue: flutter#149033
mboetger pushed a commit to mboetger/flutter that referenced this pull request Jul 28, 2025
This enables support for dynamic view resizing in non-web embedders.
While this patch enables support and exposes API for dynamic view
resizing in non-web embedders and in the embedder API, it does not
*implement* support in any embedder.

This feature is restricted to embedders with merged UI and platform
thread due to the need to inform the embedder of the updated view size
synchronously with presenting the content. With some effort, we could
implement synchronisation logic that supports non-thread-merged
embedders. See ResizeSynchronizer in the macOS embedder for details of
what's involved.

When Flutter applications call `FlutterView.render` with a non-null
`size` parameter, the size will be compared to the existing view size
(if any), and if different, a call to `PlatformView::ResizeView` will be
triggered. Embedders can respond to this call by resizing the underlying
platform-specific FlutterView to the appropriate size.

Extracts a resize_view_callback to the embedder API that custom
embedders can register to receive the updated size from the engine, and
adapt their views accordingly.

Related patches:
* `dart:ui`: flutter/engine#48090
* framework: flutter#138648
* framework reland: flutter#140918
* Web: flutter/engine#50271

Issue: flutter#169147
Issue: flutter#149033
mboetger pushed a commit to mboetger/flutter that referenced this pull request Jul 28, 2025
This enables support for dynamic view resizing in non-web embedders.
While this patch enables support and exposes API for dynamic view
resizing in non-web embedders and in the embedder API, it does not
*implement* support in any embedder.

This feature is restricted to embedders with merged UI and platform
thread due to the need to inform the embedder of the updated view size
synchronously with presenting the content. With some effort, we could
implement synchronisation logic that supports non-thread-merged
embedders. See ResizeSynchronizer in the macOS embedder for details of
what's involved.

When Flutter applications call `FlutterView.render` with a non-null
`size` parameter, the size will be compared to the existing view size
(if any), and if different, a call to `PlatformView::ResizeView` will be
triggered. Embedders can respond to this call by resizing the underlying
platform-specific FlutterView to the appropriate size.

Extracts a resize_view_callback to the embedder API that custom
embedders can register to receive the updated size from the engine, and
adapt their views accordingly.

Related patches:
* `dart:ui`: flutter/engine#48090
* framework: flutter#138648
* framework reland: flutter#140918
* Web: flutter/engine#50271

Issue: flutter#169147
Issue: flutter#149033
mboetger pushed a commit to mboetger/flutter that referenced this pull request Jul 30, 2025
This enables support for dynamic view resizing in non-web embedders.
While this patch enables support and exposes API for dynamic view
resizing in non-web embedders and in the embedder API, it does not
*implement* support in any embedder.

This feature is restricted to embedders with merged UI and platform
thread due to the need to inform the embedder of the updated view size
synchronously with presenting the content. With some effort, we could
implement synchronisation logic that supports non-thread-merged
embedders. See ResizeSynchronizer in the macOS embedder for details of
what's involved.

When Flutter applications call `FlutterView.render` with a non-null
`size` parameter, the size will be compared to the existing view size
(if any), and if different, a call to `PlatformView::ResizeView` will be
triggered. Embedders can respond to this call by resizing the underlying
platform-specific FlutterView to the appropriate size.

Extracts a resize_view_callback to the embedder API that custom
embedders can register to receive the updated size from the engine, and
adapt their views accordingly.

Related patches:
* `dart:ui`: flutter/engine#48090
* framework: flutter#138648
* framework reland: flutter#140918
* Web: flutter/engine#50271

Issue: flutter#169147
Issue: flutter#149033
mboetger pushed a commit to mboetger/flutter that referenced this pull request Jul 31, 2025
This enables support for dynamic view resizing in non-web embedders.
While this patch enables support and exposes API for dynamic view
resizing in non-web embedders and in the embedder API, it does not
*implement* support in any embedder.

This feature is restricted to embedders with merged UI and platform
thread due to the need to inform the embedder of the updated view size
synchronously with presenting the content. With some effort, we could
implement synchronisation logic that supports non-thread-merged
embedders. See ResizeSynchronizer in the macOS embedder for details of
what's involved.

When Flutter applications call `FlutterView.render` with a non-null
`size` parameter, the size will be compared to the existing view size
(if any), and if different, a call to `PlatformView::ResizeView` will be
triggered. Embedders can respond to this call by resizing the underlying
platform-specific FlutterView to the appropriate size.

Extracts a resize_view_callback to the embedder API that custom
embedders can register to receive the updated size from the engine, and
adapt their views accordingly.

Related patches:
* `dart:ui`: flutter/engine#48090
* framework: flutter#138648
* framework reland: flutter#140918
* Web: flutter/engine#50271

Issue: flutter#169147
Issue: flutter#149033
mboetger pushed a commit to mboetger/flutter that referenced this pull request Aug 4, 2025
This enables support for dynamic view resizing in non-web embedders.
While this patch enables support and exposes API for dynamic view
resizing in non-web embedders and in the embedder API, it does not
*implement* support in any embedder.

This feature is restricted to embedders with merged UI and platform
thread due to the need to inform the embedder of the updated view size
synchronously with presenting the content. With some effort, we could
implement synchronisation logic that supports non-thread-merged
embedders. See ResizeSynchronizer in the macOS embedder for details of
what's involved.

When Flutter applications call `FlutterView.render` with a non-null
`size` parameter, the size will be compared to the existing view size
(if any), and if different, a call to `PlatformView::ResizeView` will be
triggered. Embedders can respond to this call by resizing the underlying
platform-specific FlutterView to the appropriate size.

Extracts a resize_view_callback to the embedder API that custom
embedders can register to receive the updated size from the engine, and
adapt their views accordingly.

Related patches:
* `dart:ui`: flutter/engine#48090
* framework: flutter#138648
* framework reland: flutter#140918
* Web: flutter/engine#50271

Issue: flutter#169147
Issue: flutter#149033
mboetger pushed a commit to mboetger/flutter that referenced this pull request Aug 8, 2025
This enables support for dynamic view resizing in non-web embedders.
While this patch enables support and exposes API for dynamic view
resizing in non-web embedders and in the embedder API, it does not
*implement* support in any embedder.

This feature is restricted to embedders with merged UI and platform
thread due to the need to inform the embedder of the updated view size
synchronously with presenting the content. With some effort, we could
implement synchronisation logic that supports non-thread-merged
embedders. See ResizeSynchronizer in the macOS embedder for details of
what's involved.

When Flutter applications call `FlutterView.render` with a non-null
`size` parameter, the size will be compared to the existing view size
(if any), and if different, a call to `PlatformView::ResizeView` will be
triggered. Embedders can respond to this call by resizing the underlying
platform-specific FlutterView to the appropriate size.

Extracts a resize_view_callback to the embedder API that custom
embedders can register to receive the updated size from the engine, and
adapt their views accordingly.

Related patches:
* `dart:ui`: flutter/engine#48090
* framework: flutter#138648
* framework reland: flutter#140918
* Web: flutter/engine#50271

Issue: flutter#169147
Issue: flutter#149033
github-merge-queue bot pushed a commit that referenced this pull request Sep 18, 2025
Part of #169147 (iOS) and
#149033 (Android).
Implementation PRs coming up!

This enables support for dynamic view resizing in non-web embedders.
While this PR enables support, it does not _implement_ support.

Specifically, this creates the pipes (in viewport metrics) for min/max
width/height constraints that tell the engine and framework that when
rendering the frame it should adjust the width/height as needed for the
content. The engine should also discard layer trees that do not fit the
constraints.

Since the engine now relies on BoxConstraints, geometry.h has now been
moved out of embedder specific codepath so that both embedder and engine
can depend on it.

Related PRs:
`dart:ui`: flutter/engine#48090
`framework`: #138648
`framework reland`: #140918
`Web`: flutter/engine#50271

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

---------

Co-authored-by: Matt Boetger <[email protected]>
Co-authored-by: Matt Boetger <[email protected]>
Jaineel-Mamtora pushed a commit to Jaineel-Mamtora/flutter_forked that referenced this pull request Sep 24, 2025
Part of flutter#169147 (iOS) and
flutter#149033 (Android).
Implementation PRs coming up!

This enables support for dynamic view resizing in non-web embedders.
While this PR enables support, it does not _implement_ support.

Specifically, this creates the pipes (in viewport metrics) for min/max
width/height constraints that tell the engine and framework that when
rendering the frame it should adjust the width/height as needed for the
content. The engine should also discard layer trees that do not fit the
constraints.

Since the engine now relies on BoxConstraints, geometry.h has now been
moved out of embedder specific codepath so that both embedder and engine
can depend on it.

Related PRs:
`dart:ui`: flutter/engine#48090
`framework`: flutter#138648
`framework reland`: flutter#140918
`Web`: flutter/engine#50271

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

---------

Co-authored-by: Matt Boetger <[email protected]>
Co-authored-by: Matt Boetger <[email protected]>
lucaantonelli pushed a commit to lucaantonelli/flutter that referenced this pull request Nov 21, 2025
Part of flutter#169147 (iOS) and
flutter#149033 (Android).
Implementation PRs coming up!

This enables support for dynamic view resizing in non-web embedders.
While this PR enables support, it does not _implement_ support.

Specifically, this creates the pipes (in viewport metrics) for min/max
width/height constraints that tell the engine and framework that when
rendering the frame it should adjust the width/height as needed for the
content. The engine should also discard layer trees that do not fit the
constraints.

Since the engine now relies on BoxConstraints, geometry.h has now been
moved out of embedder specific codepath so that both embedder and engine
can depend on it.

Related PRs:
`dart:ui`: flutter/engine#48090
`framework`: flutter#138648
`framework reland`: flutter#140918
`Web`: flutter/engine#50271

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

---------

Co-authored-by: Matt Boetger <[email protected]>
Co-authored-by: Matt Boetger <[email protected]>
reidbaker pushed a commit to AbdeMohlbi/flutter that referenced this pull request Dec 10, 2025
Part of flutter#169147 (iOS) and
flutter#149033 (Android).
Implementation PRs coming up!

This enables support for dynamic view resizing in non-web embedders.
While this PR enables support, it does not _implement_ support.

Specifically, this creates the pipes (in viewport metrics) for min/max
width/height constraints that tell the engine and framework that when
rendering the frame it should adjust the width/height as needed for the
content. The engine should also discard layer trees that do not fit the
constraints.

Since the engine now relies on BoxConstraints, geometry.h has now been
moved out of embedder specific codepath so that both embedder and engine
can depend on it.

Related PRs:
`dart:ui`: flutter/engine#48090
`framework`: flutter#138648
`framework reland`: flutter#140918
`Web`: flutter/engine#50271

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

---------

Co-authored-by: Matt Boetger <[email protected]>
Co-authored-by: Matt Boetger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: tests "flutter test", flutter_test, or one of our tests autosubmit Merge PR when tree becomes green via auto submit App framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants