| Flutter iOS Embedder |

Instance Methods | Properties | List of all members
TestKeyEvent Class Reference
Inheritance diagram for TestKeyEvent:

## Instance Methods
(nonnull instancetype) | - initWithEvent:callback:userData:
(BOOL) | - hasCallback
(void) | - respond:

## Properties
FlutterKeyEvent * | data
FlutterKeyEventCallback | callback
_VoidPtr | userData

## Detailed Description

Definition at line 27 of file FlutterEmbedderKeyResponderTest.mm.

## Method Documentation

## ◆ hasCallback

- (BOOL) hasCallback |  |  |

Definition at line 55 of file FlutterEmbedderKeyResponderTest.mm.

55 {
56 return _callback != nil;
57 }

## ◆ initWithEvent:callback:userData:

- (instancetype) initWithEvent: |  | (const FlutterKeyEvent*) | event
callback: |  | (nullable FlutterKeyEventCallback) | callback
userData: |  | (nullable _VoidPtr) | userData

Definition at line 39 of file FlutterEmbedderKeyResponderTest.mm.

39 :(const FlutterKeyEvent*)event
40 callback:(nullable FlutterKeyEventCallback)callback
41 userData:(nullable _VoidPtr)userData {
42 self = [super init];
43 _data = new FlutterKeyEvent(*event);
44 if (event->character != nullptr) {
45 size_t len = strlen(event->character);
46 char* character = new char[len + 1];
47 strlcpy(character, event->character, len + 1);
48 _data->character = character;
49 }
50 _callback = callback;
51 _userData = userData;
52 return self;
53 }

References callback, and userData.

## ◆ respond:

- (void) respond: |  | (BOOL) | handled |

Definition at line 59 of file FlutterEmbedderKeyResponderTest.mm.

59 :(BOOL)handled {
60 NSAssert(
61 _callback != nil,
62 @"Improper call to `respond` that does not have a callback."); // Caller's responsibility
63 _callback(handled, _userData);
64 }

## Property Documentation

## ◆ callback

- (FlutterKeyEventCallback) callback
| read write nonatomic assign

Definition at line 29 of file FlutterEmbedderKeyResponderTest.mm.

Referenced by initWithEvent:callback:userData:.

## ◆ data

- (FlutterKeyEvent*) data
| read write nonatomic assign

Definition at line 28 of file FlutterEmbedderKeyResponderTest.mm.

## ◆ userData

- (_VoidPtr) userData
| read write nonatomic assign

Definition at line 30 of file FlutterEmbedderKeyResponderTest.mm.

Referenced by initWithEvent:callback:userData:.

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

- shell/platform/darwin/ios/framework/Source/FlutterEmbedderKeyResponderTest.mm

TestKeyEvent::callback
FlutterKeyEventCallback callback
Definition: FlutterEmbedderKeyResponderTest.mm:29
TestKeyEvent::userData
_VoidPtr userData
Definition: FlutterEmbedderKeyResponderTest.mm:30