Package io.flutter.plugin.platform
Class PlatformViewFactory
- java.lang.Object
-
- io.flutter.plugin.platform.PlatformViewFactory
-
public abstract class PlatformViewFactory extends Object
-
-
Constructor Summary
Constructors Constructor Description PlatformViewFactory(MessageCodec<Object> createArgsCodec)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract PlatformView
create(Context context, int viewId, Object args)
Creates a new Android view to be embedded in the Flutter hierarchy.MessageCodec<Object>
getCreateArgsCodec()
Returns the codec to be used for decoding the args parameter ofcreate(android.content.Context, int, java.lang.Object)
.
-
-
-
Constructor Detail
-
PlatformViewFactory
public PlatformViewFactory(@Nullable MessageCodec<Object> createArgsCodec)
- Parameters:
createArgsCodec
- the codec used to decode the args parameter ofcreate(android.content.Context, int, java.lang.Object)
.
-
-
Method Detail
-
create
@NonNull public abstract PlatformView create(Context context, int viewId, @Nullable Object args)
Creates a new Android view to be embedded in the Flutter hierarchy.- Parameters:
context
- the context to be used when creating the view, this is different than FlutterView's context.viewId
- unique identifier for the created instance, this value is known on the Dart side.args
- arguments sent from the Flutter app. The bytes for this value are decoded using the createArgsCodec argument passed to the constructor. This is null if createArgsCodec was null, or no arguments were sent from the Flutter app.
-
getCreateArgsCodec
@Nullable public final MessageCodec<Object> getCreateArgsCodec()
Returns the codec to be used for decoding the args parameter ofcreate(android.content.Context, int, java.lang.Object)
.
-
-