Flutter Engine
The Flutter Engine
Instance Methods | List of all members
FlutterViewWrapper Class Reference
Inheritance diagram for FlutterViewWrapper:

Instance Methods

(void) - setBackgroundColor:
 
(instancetype) - initWithFlutterView:controller: [implementation]
 
(BOOL- performKeyEquivalent: [implementation]
 
(NSArray *) - accessibilityChildren [implementation]
 
(void) - mouseDown: [implementation]
 
(void) - mouseUp: [implementation]
 

Detailed Description

FlutterViewWrapper is a convenience class that wraps a FlutterView and provides a mechanism to attach AppKit views such as FlutterTextField without affecting the accessibility subtree of the wrapped FlutterView itself.

The FlutterViewController uses this class to create its content view. When any of the accessibility services (e.g. VoiceOver) is turned on, the accessibility bridge creates FlutterTextFields that interact with the service. The bridge has to attach the FlutterTextField somewhere in the view hierarchy in order for the FlutterTextField to interact correctly with VoiceOver. Those FlutterTextFields will be attached to this view so that they won't affect the accessibility subtree of FlutterView.

Definition at line 154 of file FlutterViewController.mm.

Method Documentation

◆ accessibilityChildren

- (NSArray *) accessibilityChildren
implementation

Definition at line 252 of file FlutterViewController.mm.

285 {
286 return @[ _flutterView ];
287}

◆ initWithFlutterView:controller:

- (instancetype) initWithFlutterView: (FlutterView*)  view
controller: (FlutterViewController*)  controller 
implementation

Definition at line 252 of file FlutterViewController.mm.

255 :(FlutterView*)view
256 controller:(FlutterViewController*)controller {
257 self = [super initWithFrame:NSZeroRect];
258 if (self) {
259 _flutterView = view;
260 _controller = controller;
261 view.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;
262 [self addSubview:view];
263 }
264 return self;
265}
fml::scoped_nsobject< FlutterView > _flutterView
__weak FlutterViewController * _controller

◆ mouseDown:

- (void) mouseDown: (NSEvent*)  event
implementation

Definition at line 252 of file FlutterViewController.mm.

289 :(NSEvent*)event {
290 // Work around an AppKit bug where mouseDown/mouseUp are not called on the view controller if the
291 // view is the content view of an NSPopover AND macOS's Reduced Transparency accessibility setting
292 // is enabled.
293 //
294 // This simply calls mouseDown on the next responder in the responder chain as the default
295 // implementation on NSResponder is documented to do.
296 //
297 // See: https://github.com/flutter/flutter/issues/115015
298 // See: http://www.openradar.me/FB12050037
299 // See: https://developer.apple.com/documentation/appkit/nsresponder/1524634-mousedown
300 [self.nextResponder mouseDown:event];
301}
FlKeyEvent * event

◆ mouseUp:

- (void) mouseUp: (NSEvent*)  event
implementation

Definition at line 252 of file FlutterViewController.mm.

303 :(NSEvent*)event {
304 // Work around an AppKit bug where mouseDown/mouseUp are not called on the view controller if the
305 // view is the content view of an NSPopover AND macOS's Reduced Transparency accessibility setting
306 // is enabled.
307 //
308 // This simply calls mouseUp on the next responder in the responder chain as the default
309 // implementation on NSResponder is documented to do.
310 //
311 // See: https://github.com/flutter/flutter/issues/115015
312 // See: http://www.openradar.me/FB12050037
313 // See: https://developer.apple.com/documentation/appkit/nsresponder/1535349-mouseup
314 [self.nextResponder mouseUp:event];
315}

◆ performKeyEquivalent:

- (BOOL) performKeyEquivalent: (NSEvent*)  event
implementation

Definition at line 252 of file FlutterViewController.mm.

271 :(NSEvent*)event {
272 // Do not intercept the event if flutterView is not first responder, otherwise this would
273 // interfere with TextInputPlugin, which also handles key equivalents.
274 //
275 // Also do not intercept the event if key equivalent is a product of an event being
276 // redispatched by the TextInputPlugin, in which case it needs to bubble up so that menus
277 // can handle key equivalents.
278 if (self.window.firstResponder != _flutterView || [_controller isDispatchingKeyEvent:event]) {
279 return [super performKeyEquivalent:event];
280 }
281 [_flutterView keyDown:event];
282 return YES;
283}
GLFWwindow * window
Definition: main.cc:45

◆ setBackgroundColor:

- (void) setBackgroundColor: (NSColor*)  color

Definition at line 252 of file FlutterViewController.mm.

267 :(NSColor*)color {
268 [_flutterView setBackgroundColor:color];
269}
DlColor color

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