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 39 of file FlutterView.h.

Method Documentation

◆ initWithCoder:

- (instancetype) initWithCoder: (NSCoder*)  NS_UNAVAILABLE

Definition at line 35 of file FlutterView.mm.

35  :(NSCoder*)aDecoder {
36  NSAssert(NO, @"FlutterView must initWithDelegate");
37  return nil;
38 }

◆ initWithDelegate:opaque:enableWideGamut:

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

Definition at line 71 of file FlutterView.mm.

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

References _isWideGamutEnabled.

◆ initWithFrame:

- (instancetype) initWithFrame: (CGRect)  NS_UNAVAILABLE

Definition at line 30 of file FlutterView.mm.

30  :(CGRect)frame {
31  NSAssert(NO, @"FlutterView must initWithDelegate");
32  return nil;
33 }

◆ NS_UNAVAILABLE [1/2]

+ (instancetype) NS_UNAVAILABLE

◆ NS_UNAVAILABLE [2/2]

- (instancetype) NS_UNAVAILABLE

◆ pixelFormat

- (MTLPixelFormat) pixelFormat

Definition at line 47 of file FlutterView.mm.

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

◆ screen

- (UIScreen *) screen

Definition at line 40 of file FlutterView.mm.

40  {
41  if (@available(iOS 13.0, *)) {
42  return self.window.windowScene.screen;
43  }
44  return UIScreen.mainScreen;
45 }

Property Documentation

◆ forceSoftwareRendering

- (BOOL) forceSoftwareRendering
readwritenonatomicassign

Definition at line 54 of file FlutterView.h.


The documentation for this class was generated from the following files:
_isWideGamutEnabled
BOOL _isWideGamutEnabled
Definition: FlutterView.mm:20