Flutter macOS Embedder
FakeMessageChannel Class Reference
Inheritance diagram for FakeMessageChannel:
FlutterBasicMessageChannel

Instance Methods

(instancetype) - init
 
(void) - sendMessage:
 
(void) - sendMessage:reply:
 
- Instance Methods inherited from FlutterBasicMessageChannel
(instancetype) - initWithName:binaryMessenger:codec:
 
(instancetype) - initWithName:binaryMessenger:codec:taskQueue:
 
(void) - setMessageHandler:
 
(void) - resizeChannelBuffer:
 
(void) - setWarnsOnOverflow:
 

Properties

NSMutableArray< id > * messages
 
NSDictionary * nextResponse
 

Additional Inherited Members

- Class Methods inherited from FlutterBasicMessageChannel
(instancetype) + messageChannelWithName:binaryMessenger:
 
(instancetype) + messageChannelWithName:binaryMessenger:codec:
 
(void) + resizeChannelWithName:binaryMessenger:size:
 
(void) + setWarnsOnOverflow:forChannelWithName:binaryMessenger:
 

Detailed Description

Definition at line 19 of file FlutterChannelKeyResponderTest.mm.

Method Documentation

◆ init

- (instancetype) init

Definition at line 29 of file FlutterChannelKeyResponderTest.mm.

29  {
30  self = [super init];
31  if (self != nil) {
32  _messages = [[NSMutableArray<id> alloc] init];
33  }
34  return self;
35 }

◆ sendMessage:

- (void) sendMessage: (id _Nullable)  message

Sends the specified message to the Flutter side, ignoring any reply.

Parameters
messageThe message. Must be supported by the codec of this channel.

Reimplemented from FlutterBasicMessageChannel.

Definition at line 37 of file FlutterChannelKeyResponderTest.mm.

37  :(id _Nullable)message {
38  [self sendMessage:message reply:nil];
39 }

References sendMessage:reply:.

◆ sendMessage:reply:

- (void) sendMessage: (id _Nullable)  message
reply: (FlutterReply _Nullable)  callback 

Sends the specified message to the Flutter side, expecting an asynchronous reply.

Parameters
messageThe message. Must be supported by the codec of this channel.
callbackA callback to be invoked with the message reply from Flutter.

Reimplemented from FlutterBasicMessageChannel.

Definition at line 41 of file FlutterChannelKeyResponderTest.mm.

41  :(id _Nullable)message reply:(FlutterReply _Nullable)callback {
42  [_messages addObject:message];
43  if (callback) {
44  callback(_nextResponse);
45  }
46 }

Referenced by sendMessage:.

Property Documentation

◆ messages

- (NSMutableArray<id>*) messages
readnonatomicassign

Definition at line 20 of file FlutterChannelKeyResponderTest.mm.

Referenced by flutter::testing::TEST_F().

◆ nextResponse

- (NSDictionary*) nextResponse
readwritenonatomicassign

Definition at line 21 of file FlutterChannelKeyResponderTest.mm.

Referenced by flutter::testing::TEST_F().


The documentation for this class was generated from the following file:
FlutterReply
NS_ASSUME_NONNULL_BEGIN typedef void(^ FlutterReply)(id _Nullable reply)