Flutter iOS Embedder
FlutterView Class Reference

#import <FlutterView.h>

Inheritance diagram for FlutterView:

Instance Methods

(instancetype) - NS_UNAVAILABLE
 
(instancetype) - initWithFrame:
 
(instancetype) - initWithCoder:
 
(instancetype) - initWithDelegate:opaque:enableWideGamut:
 
(UIScreen *) - screen
 
(MTLPixelFormat) - pixelFormat
 

Class Methods

(instancetype) + NS_UNAVAILABLE
 

Properties

BOOL forceSoftwareRendering
 

Detailed Description

Definition at line 34 of file FlutterView.h.

Method Documentation

◆ initWithCoder:

- (instancetype) initWithCoder: (NSCoder*)  NS_UNAVAILABLE

Definition at line 29 of file FlutterView.mm.

29  :(NSCoder*)aDecoder {
30  NSAssert(NO, @"FlutterView must initWithDelegate");
31  return nil;
32 }

◆ initWithDelegate:opaque:enableWideGamut:

- (instancetype) initWithDelegate: (id<FlutterViewEngineDelegate>)  delegate
opaque: (BOOL)  opaque
enableWideGamut: (BOOL)  NS_DESIGNATED_INITIALIZER 

Definition at line 65 of file FlutterView.mm.

65  :(id<FlutterViewEngineDelegate>)delegate
66  opaque:(BOOL)opaque
67  enableWideGamut:(BOOL)isWideGamutEnabled {
68  if (delegate == nil) {
69  NSLog(@"FlutterView delegate was nil.");
70  return nil;
71  }
72 
73  self = [super initWithFrame:CGRectNull];
74 
75  if (self) {
76  _delegate = delegate;
77  _isWideGamutEnabled = isWideGamutEnabled;
78  self.layer.opaque = opaque;
79 
80  // This line is necessary. CoreAnimation(or UIKit) may take this to do
81  // something to compute the final frame presented on screen, if we don't set this,
82  // it will make it take long time for us to take next CAMetalDrawable and will
83  // cause constant junk during rendering.
84  self.backgroundColor = UIColor.clearColor;
85  }
86 
87  return self;
88 }

◆ initWithFrame:

- (instancetype) initWithFrame: (CGRect)  NS_UNAVAILABLE

Definition at line 24 of file FlutterView.mm.

24  :(CGRect)frame {
25  NSAssert(NO, @"FlutterView must initWithDelegate");
26  return nil;
27 }

◆ NS_UNAVAILABLE [1/2]

+ (instancetype) NS_UNAVAILABLE

◆ NS_UNAVAILABLE [2/2]

- (instancetype) NS_UNAVAILABLE

◆ pixelFormat

- (MTLPixelFormat) pixelFormat

Definition at line 41 of file FlutterView.mm.

41  {
42  if ([self.layer isKindOfClass:NSClassFromString(@"CAMetalLayer")]) {
43 // It is a known Apple bug that CAMetalLayer incorrectly reports its supported
44 // SDKs. It is, in fact, available since iOS 8.
45 #pragma clang diagnostic push
46 #pragma clang diagnostic ignored "-Wunguarded-availability-new"
47  CAMetalLayer* layer = (CAMetalLayer*)self.layer;
48  return layer.pixelFormat;
49  }
50  return MTLPixelFormatBGRA8Unorm;
51 }

◆ screen

- (UIScreen *) screen

Definition at line 34 of file FlutterView.mm.

34  {
35  if (@available(iOS 13.0, *)) {
36  return self.window.windowScene.screen;
37  }
38  return UIScreen.mainScreen;
39 }

Property Documentation

◆ forceSoftwareRendering

- (BOOL) forceSoftwareRendering
readwritenonatomicassign

Definition at line 49 of file FlutterView.h.


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