Flutter Engine
The Flutter Engine
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);
88 deferredComponentManager = FlutterInjector.instance().deferredComponentManager();
89 componentNameToResults = new HashMap<>();
90 }
void setMethodCallHandler(final @Nullable MethodCallHandler handler)

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

◆ 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.


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