DartEntrypoint

createDefault

()

// Cache the FlutterEngine to be used by FlutterActivity.

FlutterEngineCache

getInstance

()

put

"my_engine_id"

flutterEngine

FlutterEngineCache can be whatever you want.
Make sure that you pass the same ID to any

FlutterFragment that should use the cached

With a pre-warmed, cached FlutterEngine, you now need
to instruct your FlutterActivity to use the cached
FlutterEngine instead of creating a new one.
To accomplish this, use FlutterActivity’s withCachedEngine()
builder:

Java

Kotlin

myButton

addOnClickListener

new

OnClickListener

()

@Override

public

void