Handles platform view related method calls, for example create, dispose, etc.
91 if ([[
call method] isEqualToString:
@"create"]) {
92 NSMutableDictionary<NSString*, id>*
args = [call arguments];
93 if ([
args objectForKey:
@"id"]) {
94 int64_t viewId = [args[@"id"] longLongValue];
95 NSString* viewType = [NSString stringWithUTF8String:([args[@"viewType"] UTF8String])];
96
97 id creationArgs = nil;
98 NSObject<FlutterPlatformViewFactory>* factory = _platformViewFactories[viewType];
99 if ([factory respondsToSelector:@selector(createArgsCodec)]) {
100 NSObject<FlutterMessageCodec>* codec = [factory createArgsCodec];
101 if (codec != nil &&
args[
@"params"] != nil) {
103 creationArgs = [codec decode:creationArgsData.data];
104 }
105 }
106 [self onCreateWithViewIdentifier:viewId
107 viewType:viewType
108 arguments:creationArgs
109 result:result];
110 } else {
112 message:
@"'id' argument must be passed to create a platform view."
113 details:[NSString stringWithFormat:@"'id' not specified."]]);
114 }
115 }
else if ([[
call method] isEqualToString:
@"dispose"]) {
116 NSNumber* arg = [call arguments];
117 int64_t viewId = [arg longLongValue];
118 [self onDisposeWithViewID:viewId result:result];
119 }
else if ([[
call method] isEqualToString:
@"acceptGesture"]) {
120 [self handleAcceptGesture:call result:result];
121 }
else if ([[
call method] isEqualToString:
@"rejectGesture"]) {
122 [self handleRejectGesture:call result:result];
123 } else {
125 }
126}
FLUTTER_DARWIN_EXPORT NSObject const * FlutterMethodNotImplemented