Package io.flutter.embedding.engine
Class FlutterEngineGroupCache
java.lang.Object
io.flutter.embedding.engine.FlutterEngineGroupCache
Static singleton cache that holds
FlutterEngineGroup
instances identified by String
s.
The ID of a given FlutterEngineGroup
can be whatever
String
is desired.
FlutterActivity
and FlutterFragment
use the FlutterEngineGroupCache
singleton
internally when instructed to use a cached FlutterEngineGroup
based on a given ID. See FlutterActivity.NewEngineInGroupIntentBuilder
and FlutterFragment.withNewEngineInGroup(String)
for related APIs.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Removes allFlutterEngineGroup
's that are currently in the cache.boolean
Returns theFlutterEngineGroup
in this cache that is associated with the givenengineGroupId
, ornull
is no suchFlutterEngineGroup
exists.static FlutterEngineGroupCache
Returns the static singleton instance ofFlutterEngineGroupCache
.void
put
(String engineGroupId, FlutterEngineGroup engineGroup) Places the givenFlutterEngineGroup
in this cache and associates it with the givenengineGroupId
.void
Removes anyFlutterEngineGroup
that is currently in the cache that is identified by the givenengineGroupId
.
-
Method Details
-
getInstance
Returns the static singleton instance ofFlutterEngineGroupCache
.Creates a new instance if one does not yet exist.
-
contains
-
get
Returns theFlutterEngineGroup
in this cache that is associated with the givenengineGroupId
, ornull
is no suchFlutterEngineGroup
exists. -
put
Places the givenFlutterEngineGroup
in this cache and associates it with the givenengineGroupId
.If a
FlutterEngineGroup
is null, thatFlutterEngineGroup
is removed from this cache. -
remove
Removes anyFlutterEngineGroup
that is currently in the cache that is identified by the givenengineGroupId
. -
clear
public void clear()Removes allFlutterEngineGroup
's that are currently in the cache.
-