Flutter Engine
FlutterEngine(ScenariosTest) Category Reference

#import <FlutterEngine+ScenariosTest.h>

Instance Methods

(instancetype) - initWithScenario:withCompletion:
 

Detailed Description

Definition at line 8 of file FlutterEngine+ScenariosTest.h.

Method Documentation

◆ initWithScenario:withCompletion:()

- (instancetype) initWithScenario: (NSString*)  scenario
withCompletion: (nullable void(^)(void))  engineRunCompletion 

Extends class FlutterEngine.

Definition at line 9 of file FlutterEngine+ScenariosTest.m.

9  :(NSString*)scenario
10  withCompletion:(nullable void (^)(void))engineRunCompletion {
11  NSAssert([scenario length] != 0, @"You need to provide a scenario");
12  self = [self initWithName:[NSString stringWithFormat:@"Test engine for %@", scenario]
13  project:nil];
14  [self run];
15 
16  [self.binaryMessenger setMessageHandlerOnChannel:@"waiting_for_status"
17  binaryMessageHandler:^(NSData* message, FlutterBinaryReply reply) {
19  methodChannelWithName:@"driver"
20  binaryMessenger:self.binaryMessenger
21  codec:[FlutterJSONMethodCodec sharedInstance]];
22  [channel invokeMethod:@"set_scenario"
23  arguments:@{@"name" : scenario}];
24 
25  if (engineRunCompletion != nil) {
26  engineRunCompletion();
27  }
28  }];
29  return self;
30 }
instancetype methodChannelWithName:binaryMessenger:codec:(NSString *name, [binaryMessenger] NSObject< FlutterBinaryMessenger > *messenger, [codec] NSObject< FlutterMethodCodec > *codec)
size_t length

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