Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Package Attributes | List of all members
io.flutter.embedding.engine.systemchannels.DeferredComponentChannel Class Reference

Public Member Functions

 DeferredComponentChannel (@NonNull DartExecutor dartExecutor)
 
void setDeferredComponentManager ( @Nullable DeferredComponentManager deferredComponentManager)
 
void completeInstallSuccess (String componentName)
 
void completeInstallError (String componentName, String errorMessage)
 

Package Attributes

final MethodChannel.MethodCallHandler parsingMethodHandler
 

Detailed Description

Method channel that handles manual installation requests and queries for installation state for deferred components.

This channel is able to handle multiple simultaneous installation requests

Definition at line 28 of file DeferredComponentChannel.java.

Constructor & Destructor Documentation

◆ DeferredComponentChannel()

io.flutter.embedding.engine.systemchannels.DeferredComponentChannel.DeferredComponentChannel ( @NonNull DartExecutor  dartExecutor)
inline

Constructs a DeferredComponentChannel that connects Android to the Dart code running in dartExecutor.

The given dartExecutor is permitted to be idle or executing code.

See DartExecutor.

Definition at line 84 of file DeferredComponentChannel.java.

84 {
85 this.channel =
86 new MethodChannel(dartExecutor, "flutter/deferredcomponent", StandardMethodCodec.INSTANCE);
87 channel.setMethodCallHandler(parsingMethodHandler);
88 deferredComponentManager = FlutterInjector.instance().deferredComponentManager();
89 componentNameToResults = new HashMap<>();
90 }

Member Function Documentation

◆ completeInstallError()

void io.flutter.embedding.engine.systemchannels.DeferredComponentChannel.completeInstallError ( String  componentName,
String  errorMessage 
)
inline

Finishes the installDeferredComponent method channel call for the specified componentName with an error/failure.

Parameters
componentNameThe name of the android deferred component install request to complete.
errorMessageThe error message to display to complete the future with.

Definition at line 126 of file DeferredComponentChannel.java.

126 {
127 if (componentNameToResults.containsKey(componentName)) {
128 for (MethodChannel.Result result : componentNameToResults.get(componentName)) {
129 result.error("DeferredComponent Install failure", errorMessage, null);
130 }
131 componentNameToResults.get(componentName).clear();
132 }
133 return;
134 }
GAsyncResult * result
const myers::Point & get(const myers::Segment &)

◆ completeInstallSuccess()

void io.flutter.embedding.engine.systemchannels.DeferredComponentChannel.completeInstallSuccess ( String  componentName)
inline

Finishes the installDeferredComponent method channel call for the specified componentName with a success.

Parameters
componentNameThe name of the android deferred component install request to complete.

Definition at line 109 of file DeferredComponentChannel.java.

109 {
110 if (componentNameToResults.containsKey(componentName)) {
111 for (MethodChannel.Result result : componentNameToResults.get(componentName)) {
112 result.success(null);
113 }
114 componentNameToResults.get(componentName).clear();
115 }
116 return;
117 }

◆ setDeferredComponentManager()

void io.flutter.embedding.engine.systemchannels.DeferredComponentChannel.setDeferredComponentManager ( @Nullable DeferredComponentManager  deferredComponentManager)
inline

Sets the DeferredComponentManager to exectue method channel calls with.

Parameters
deferredComponentManagerthe DeferredComponentManager to use.

Definition at line 98 of file DeferredComponentChannel.java.

99 {
100 this.deferredComponentManager = deferredComponentManager;
101 }

Member Data Documentation

◆ parsingMethodHandler

final MethodChannel.MethodCallHandler io.flutter.embedding.engine.systemchannels.DeferredComponentChannel.parsingMethodHandler
package

Definition at line 39 of file DeferredComponentChannel.java.

40 {
41 @Override
42 public void onMethodCall(@NonNull MethodCall call, @NonNull MethodChannel.Result result) {
43 if (deferredComponentManager == null) {
44 // If no DeferredComponentManager has been injected, then this channel is a no-op.
45 return;
46 }
47 String method = call.method;
48 Map<String, Object> args = call.arguments();
49 Log.v(TAG, "Received '" + method + "' message.");
50 final int loadingUnitId = (int) args.get("loadingUnitId");
51 final String componentName = (String) args.get("componentName");
52 switch (method) {
53 case "installDeferredComponent":
54 deferredComponentManager.installDeferredComponent(loadingUnitId, componentName);
55 if (!componentNameToResults.containsKey(componentName)) {
56 componentNameToResults.put(componentName, new ArrayList<>());
57 }
58 componentNameToResults.get(componentName).add(result);
59 break;
60 case "getDeferredComponentInstallState":
61 result.success(
62 deferredComponentManager.getDeferredComponentInstallState(
63 loadingUnitId, componentName));
64 break;
65 case "uninstallDeferredComponent":
66 deferredComponentManager.uninstallDeferredComponent(loadingUnitId, componentName);
67 result.success(null);
68 break;
69 default:
70 result.notImplemented();
71 break;
72 }
73 }
74 };
Type::kYUV Type::kRGBA() int(0.7 *637)
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
static ::testing::Matcher< GBytes * > MethodCall(const std::string &name, ::testing::Matcher< FlValue * > args)
void Log(const char *format,...) SK_PRINTF_LIKE(1
call(args)
Definition dom.py:159

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