| Flutter iOS Embedder |

Public Member Functions | Public Attributes | List of all members
flutter::OverlayLayer Struct Reference

State holder for a Flutter overlay layer. More...

`#include <overlay_layer_pool.h>`

## Public Member Functions
| OverlayLayer (UIView *overlay_view, UIView *overlay_view_wrapper, std::unique_ptr< IOSSurface > ios_surface, std::unique_ptr< Surface > surface)
| ~OverlayLayer ()=default
void | UpdateViewState (UIView *flutter_view, SkRect rect, int64_t view_id, int64_t overlay_id)

## Public Attributes
UIView * | overlay_view
UIView * | overlay_view_wrapper
std::unique_ptr< IOSSurface > | ios_surface
std::unique_ptr< Surface > | surface
bool | did_submit_last_frame

## Detailed Description

State holder for a Flutter overlay layer.

Definition at line 22 of file overlay_layer_pool.h.

## Constructor & Destructor Documentation

## ◆ OverlayLayer()

flutter::OverlayLayer::OverlayLayer | ( | UIView * | overlay_view,
|  | UIView * | overlay_view_wrapper,
|  | std::unique_ptr< IOSSurface > | ios_surface,
|  | std::unique_ptr< Surface > | surface
| ) |  |

Definition at line 12 of file overlay_layer_pool.mm.

16 : overlay_view(overlay_view),
17 overlay_view_wrapper(overlay_view_wrapper),
18 ios_surface(std::move(ios_surface)),
19 surface(std::move(surface)){};
flutter::OverlayLayer::surface
std::unique_ptr< Surface > surface
Definition: overlay_layer_pool.h:33
flutter::OverlayLayer::overlay_view_wrapper
UIView * overlay_view_wrapper
Definition: overlay_layer_pool.h:31
flutter::OverlayLayer::ios_surface
std::unique_ptr< IOSSurface > ios_surface
Definition: overlay_layer_pool.h:32
flutter::OverlayLayer::overlay_view
UIView * overlay_view
Definition: overlay_layer_pool.h:30

## ◆ ~OverlayLayer()

flutter::OverlayLayer::~OverlayLayer | ( |  | ) |
| default

## Member Function Documentation

## ◆ UpdateViewState()

void flutter::OverlayLayer::UpdateViewState | ( | UIView * | flutter_view,
|  | SkRect | rect,
|  | int64_t | view_id,
|  | int64_t | overlay_id
| ) |  |

Definition at line 21 of file overlay_layer_pool.mm.

24 {
25 auto screenScale = [UIScreen mainScreen].scale;
26 // Set the size of the overlay view wrapper.
27 // This wrapper view masks the overlay view.
28 overlay_view_wrapper.frame = CGRectMake(rect.x() / screenScale, rect.y() / screenScale,
29 rect.width() / screenScale, rect.height() / screenScale);
30 // Set a unique view identifier, so the overlay_view_wrapper can be identified in XCUITests.
31 overlay_view_wrapper.accessibilityIdentifier =
32 [NSString stringWithFormat:@"platform_view[%lld].overlay[%lld]", view_id, overlay_id];
33
34 // Set the size of the overlay view.
35 // This size is equal to the device screen size.
36 overlay_view.frame = [flutter_view convertRect:flutter_view.bounds toView:overlay_view_wrapper];
37 // Set a unique view identifier, so the overlay_view can be identified in XCUITests.
38 overlay_view.accessibilityIdentifier =
39 [NSString stringWithFormat:@"platform_view[%lld].overlay_view[%lld]", view_id, overlay_id];
40 }

References overlay_view, and overlay_view_wrapper.

## Member Data Documentation

## ◆ did_submit_last_frame

bool flutter::OverlayLayer::did_submit_last_frame

Definition at line 36 of file overlay_layer_pool.h.

## ◆ ios_surface

std::unique_ptr<IOSSurface> flutter::OverlayLayer::ios_surface

Definition at line 32 of file overlay_layer_pool.h.

## ◆ overlay_view

UIView* flutter::OverlayLayer::overlay_view

Definition at line 30 of file overlay_layer_pool.h.

Referenced by UpdateViewState().

## ◆ overlay_view_wrapper

UIView* flutter::OverlayLayer::overlay_view_wrapper

Definition at line 31 of file overlay_layer_pool.h.

Referenced by UpdateViewState().

## ◆ surface

std::unique_ptr<Surface> flutter::OverlayLayer::surface

Definition at line 33 of file overlay_layer_pool.h.

The documentation for this struct was generated from the following files:

- shell/platform/darwin/ios/framework/Source/overlay_layer_pool.h
- shell/platform/darwin/ios/framework/Source/overlay_layer_pool.mm