Flutter Engine
The Flutter Engine
Classes | Public Member Functions | Package Functions | List of all members
dev.flutter.scenarios.SurfacePlatformViewFactory Class Reference
Inheritance diagram for dev.flutter.scenarios.SurfacePlatformViewFactory:
io.flutter.plugin.platform.PlatformViewFactory

Public Member Functions

PlatformView create (@NonNull Context context, int id, @Nullable Object args)
 
- Public Member Functions inherited from io.flutter.plugin.platform.PlatformViewFactory
 PlatformViewFactory (@Nullable MessageCodec< Object > createArgsCodec)
 
abstract PlatformView create (Context context, int viewId, @Nullable Object args)
 
final MessageCodec< Object > getCreateArgsCodec ()
 

Package Functions

 SurfacePlatformViewFactory (boolean preserveContext)
 

Detailed Description

Definition at line 29 of file SurfacePlatformViewFactory.java.

Constructor & Destructor Documentation

◆ SurfacePlatformViewFactory()

dev.flutter.scenarios.SurfacePlatformViewFactory.SurfacePlatformViewFactory ( boolean  preserveContext)
inlinepackage

Definition at line 32 of file SurfacePlatformViewFactory.java.

32 {
33 super(
34 new MessageCodec<Object>() {
35 @Nullable
36 @Override
37 public ByteBuffer encodeMessage(@Nullable Object o) {
38 if (o instanceof String) {
39 return StringCodec.INSTANCE.encodeMessage((String) o);
40 }
41 return null;
42 }
43
44 @Nullable
45 @Override
46 public Object decodeMessage(@Nullable ByteBuffer byteBuffer) {
47 return StringCodec.INSTANCE.decodeMessage(byteBuffer);
48 }
49 });
50 this.preserveContext = preserveContext;
51 }

Member Function Documentation

◆ create()

PlatformView dev.flutter.scenarios.SurfacePlatformViewFactory.create ( @NonNull Context  context,
int  id,
@Nullable Object  args 
)
inline

Definition at line 56 of file SurfacePlatformViewFactory.java.

56 {
57 if (preserveContext) {
58 return new SurfacePlatformView(context);
59 } else {
60 final Context differentContext = new ContextWrapper(context);
61 return new SurfacePlatformView(differentContext);
62 }
63 }

The documentation for this class was generated from the following file: