Skip to content

Don't build surface until the platform view has been created#101399

Merged
fluttergithubbot merged 14 commits intoflutter:masterfrom
blasten:pv_placeholder
Apr 7, 2022
Merged

Don't build surface until the platform view has been created#101399
fluttergithubbot merged 14 commits intoflutter:masterfrom
blasten:pv_placeholder

Conversation

@blasten
Copy link

@blasten blasten commented Apr 6, 2022

Builds a placeholder that is used to capture the size of the render object after layout, then
it communicates the size to the controller, so the platform view can be created on platforms
that need to wait for the creation to happen prior to building the surface.

Fixes a crash issue in Fuchsia:
https://logs.chromium.org/logs/turquoise/buildbucket/cr-buildbucket/8817759165575272161/+/u/failures/AEMU-_1_/attempt_0__fail_/failed:_fuchsia-pkg:__fuchsia.com_touch-input-test-ip_meta_touch-input-test-ip-component.cm/infra_and_test_std_and_klog.txt

@flutter-dashboard flutter-dashboard bot added the framework flutter/packages/flutter repository. See also f: labels. label Apr 6, 2022
@blasten blasten marked this pull request as ready for review April 6, 2022 19:06
@blasten blasten requested a review from cyanglaz April 6, 2022 19:06
height: double.infinity,
));

_OnLayoutCallback? onLayout;
Copy link
Contributor

Choose a reason for hiding this comment

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

can this be non-null?

Copy link
Author

Choose a reason for hiding this comment

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

done

Emmanuel Garcia added 2 commits April 6, 2022 15:34
@blasten blasten requested a review from cyanglaz April 6, 2022 22:46
Emmanuel Garcia added 2 commits April 6, 2022 18:22
@blasten blasten requested a review from cyanglaz April 7, 2022 17:15
Copy link
Contributor

@cyanglaz cyanglaz left a comment

Choose a reason for hiding this comment

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

LGTM % nits

cyanglaz pushed a commit that referenced this pull request Apr 8, 2022
@blasten blasten deleted the pv_placeholder branch April 18, 2022 23:47
stuartmorgan-g added a commit to stuartmorgan-g/flutter that referenced this pull request Aug 9, 2022
Fixes regressions from flutter#101399:
- For Hybrid Composition, there is a common race where `create` will be
  called by the `PlatformViewLink` even though it has already been
  successfully called by the plugin itself. This causes exceptions on
  use of many Hybrid Composition plugins, and blocks adopting the new
  forced-HC mode in the google_maps_flutter plugin, for instance.
- The documented behavior of `AndroidViewController`, which is that
  `setSize` would create it on demand, was removed. That logic had been
  moved to an internal call site, but there may have been public callers
  expecting that behavior as well so it's better to keep the logic in
  the code documented to have that behavior.

Part of flutter#107297
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants