147 :(NSString*)scenarioIdentifier {
150 [self flutterViewControllerForTest:scenarioIdentifier withEngine:engine];
151 flutterViewController.
view.accessibilityIdentifier =
@"flutter_view";
152
153 [engine.binaryMessenger
160 [channel invokeMethod:@"set_scenario" arguments:@{@"name" : scenarioIdentifier}];
161 }];
162
163 [engine.binaryMessenger
166 NSDictionary* dict = [NSJSONSerialization JSONObjectWithData:message
167 options:0
168 error:nil];
169 UITextField* text = [[UITextField alloc] initWithFrame:CGRectMake(0, 400, 300, 100)];
170 text.text = dict[@"data"];
171 [flutterViewController.view addSubview:text];
172 }];
173
176 NSObject<FlutterPluginRegistrar>* registrar =
178 [registrar registerViewFactory:textPlatformViewFactory
179 withId:@"scenarios/textPlatformView"
180 gestureRecognizersBlockingPolicy:FlutterPlatformViewGestureRecognizersBlockingPolicyEager];
181 [registrar registerViewFactory:textPlatformViewFactory
182 withId:@"scenarios/textPlatformView_blockPolicyUntilTouchesEnded"
183 gestureRecognizersBlockingPolicy:
184 FlutterPlatformViewGestureRecognizersBlockingPolicyWaitUntilTouchesEnded];
185
186 UIViewController* rootViewController = flutterViewController;
187
188 if ([scenarioIdentifier isEqualToString:@"non_full_screen_flutter_view_platform_view"]) {
190 [rootViewController.view addSubview:flutterViewController.view];
191 flutterViewController.
view.frame = CGRectMake(150, 150, 500, 500);
192 }
193
194 self.window.rootViewController = rootViewController;
195
196 if ([[[NSProcessInfo processInfo] arguments] containsObject:@"--assert-ca-layer-type"]) {
197 if ([[[NSProcessInfo processInfo] arguments] containsObject:@"--enable-software-rendering"]) {
198 NSAssert([flutterViewController.
view.layer isKindOfClass:[CALayer
class]],
199 @"Expected CALayer for software rendering.");
200 } else {
201 NSAssert([flutterViewController.
view.layer isKindOfClass:[CAMetalLayer
class]],
202 @"Expected CAMetalLayer for non-software rendering.");
203 }
204 }
205}
FlutterBinaryMessengerConnection setMessageHandlerOnChannel:binaryMessageHandler:(NSString *channel, [binaryMessageHandler] FlutterBinaryMessageHandler handler)
NSObject< FlutterPluginRegistrar > * registrarForPlugin:(NSString *pluginKey)
instancetype sharedInstance()
instancetype methodChannelWithName:binaryMessenger:codec:(NSString *name,[binaryMessenger] NSObject< FlutterBinaryMessenger > *messenger,[codec] NSObject< FlutterMethodCodec > *codec)