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
 

Detailed Description

Definition at line 32 of file FlutterView.h.

Method Documentation

◆ initWithCoder:

- (instancetype) initWithCoder: (NSCoder*)  NS_UNAVAILABLE

Definition at line 14 of file FlutterView.mm.

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

◆ initWithDelegate:opaque:enableWideGamut:

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

Definition at line 14 of file FlutterView.mm.

66  :(id<FlutterViewEngineDelegate>)delegate
67  opaque:(BOOL)opaque
68  enableWideGamut:(BOOL)isWideGamutEnabled {
69  if (delegate == nil) {
70  NSLog(@"FlutterView delegate was nil.");
71  return nil;
72  }
73 
74  self = [super initWithFrame:CGRectNull];
75 
76  if (self) {
77  _delegate = delegate;
78  _isWideGamutEnabled = isWideGamutEnabled;
79  self.layer.opaque = opaque;
80  }
81 
82  return self;
83 }

◆ initWithFrame:

- (instancetype) initWithFrame: (CGRect)  NS_UNAVAILABLE

Definition at line 14 of file FlutterView.mm.

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

◆ NS_UNAVAILABLE [1/2]

+ (instancetype) NS_UNAVAILABLE

◆ NS_UNAVAILABLE [2/2]

- (instancetype) NS_UNAVAILABLE

◆ pixelFormat

- (MTLPixelFormat) pixelFormat

Definition at line 14 of file FlutterView.mm.

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

◆ screen

- (UIScreen *) screen

Definition at line 14 of file FlutterView.mm.

36  {
37  return self.window.windowScene.screen;
38 }

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