this

Replace "/my_route" with your desired initial route.

The use of the withNewEngine() factory method
configures a FlutterActivity that internally create
its own FlutterEngine instance. This comes with a
non-trivial initialization time. The alternative approach
is to instruct FlutterActivity to use a pre-warmed,
cached FlutterEngine, which minimizes Flutter’s
initialization time. That approach is discussed next.

Step 3: (Optional) Use a cached FlutterEngine

To pre-warm a FlutterEngine, find a reasonable
location in your app to instantiate a FlutterEngine.
The following example arbitrarily pre-warms a
FlutterEngine in the Application class:

Java

Kotlin

public

class

MyApplication

extends

Application

public

FlutterEngine

flutterEngine

@Override