Created
June 29, 2020 13:19
-
-
Save kmmraj/b4b6a31e8acff9c34fdd0267f59c7677 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AppController : Application() { | |
lateinit var engine: FlutterEngine | |
override fun onCreate() { | |
super.onCreate() | |
// Instantiate a FlutterEngine. | |
engine = FlutterEngine(this) | |
// Start executing Dart code to pre-warm the FlutterEngine. | |
engine.dartExecutor.executeDartEntrypoint( | |
DartExecutor.DartEntrypoint.createDefault() | |
) | |
// Cache the FlutterEngine to be used by FlutterActivity. | |
FlutterEngineCache | |
.getInstance() | |
.put("my_engine_id", engine) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment