package com.demo.library_flutter.nativeview; import android.content.Context; import java.util.Map; import io.flutter.plugin.common.BinaryMessenger; import io.flutter.plugin.common.MessageCodec; import io.flutter.plugin.platform.PlatformView; import io.flutter.plugin.platform.PlatformViewFactory; public class CSJExpressNativeViewFactory extends PlatformViewFactory { private BinaryMessenger binaryMessenger; /** * @param createArgsCodec the codec used to decode the args parameter of {@link #create}. */ public CSJExpressNativeViewFactory(BinaryMessenger binaryMessenger, MessageCodec createArgsCodec) { super(createArgsCodec); this.binaryMessenger = binaryMessenger; } @Override public PlatformView create(Context context, int viewId, Object args) { //参数 Map params = (Map) args; CSJExpressNativeView view = new CSJExpressNativeView(viewId, params, context, binaryMessenger); return view; } }