未验证 提交 c79faed7 编写于 作者: A Amir Hardon 提交者: GitHub

Decode UIView's creation parameters and pass them to the view factory. (#6715)

上级 467ff33a
......@@ -60,10 +60,21 @@ void FlutterPlatformViewsController::OnCreate(FlutterMethodCall* call, FlutterRe
return;
}
// TODO(amirh): decode and pass the creation args.
FlutterTouchInterceptingView* view = [[[FlutterTouchInterceptingView alloc]
initWithEmbeddedView:[factory createWithFrame:CGRectZero viewIdentifier:viewId arguments:nil]
flutterView:flutter_view_] autorelease];
id params = nil;
if ([factory respondsToSelector:@selector(createArgsCodec)]) {
NSObject<FlutterMessageCodec>* codec = [factory createArgsCodec];
if (codec != nil && args[@"params"] != nil) {
FlutterStandardTypedData* paramsData = args[@"params"];
params = [codec decode:paramsData.data];
}
}
UIView* embedded_view = [factory createWithFrame:CGRectZero
viewIdentifier:viewId
arguments:params];
FlutterTouchInterceptingView* view =
[[[FlutterTouchInterceptingView alloc] initWithEmbeddedView:embedded_view
flutterView:flutter_view_] autorelease];
views_[viewId] = fml::scoped_nsobject<FlutterTouchInterceptingView>([view retain]);
result(nil);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册