◆ 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 }
◆ 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: