Flutter Engine
The Flutter Engine
shell
platform
android
io
flutter
embedding
android
FlutterEngineProvider.java
Go to the documentation of this file.
1
// Copyright 2013 The Flutter Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style license that can be
3
// found in the LICENSE file.
4
5
package
io.flutter.embedding.android;
6
7
import
android
.content.Context;
8
import
androidx.annotation.NonNull;
9
import
androidx.annotation.Nullable;
10
import
io.flutter.embedding.engine.FlutterEngine;
11
12
/**
13
* Provides a {@link io.flutter.embedding.engine.FlutterEngine} instance to be used by a {@code
14
* FlutterActivity} or {@code FlutterFragment}.
15
*
16
* <p>{@link io.flutter.embedding.engine.FlutterEngine} instances require significant time to warm
17
* up. Therefore, a developer might choose to hold onto an existing {@link
18
* io.flutter.embedding.engine.FlutterEngine} and connect it to various {@link FlutterActivity}s
19
* and/or {@code FlutterFragment}s. This interface facilitates providing a cached, pre-warmed {@link
20
* io.flutter.embedding.engine.FlutterEngine}.
21
*/
22
public
interface
FlutterEngineProvider
{
23
/**
24
* Returns the {@link io.flutter.embedding.engine.FlutterEngine} that should be used by a child
25
* {@code FlutterFragment}.
26
*
27
* <p>This method may return a new {@link io.flutter.embedding.engine.FlutterEngine}, an existing,
28
* cached {@link FlutterEngine}, or null to express that the {@code FlutterEngineProvider} would
29
* like the {@code FlutterFragment} to provide its own {@code FlutterEngine} instance.
30
*
31
* @param context The current context. e.g. An activity.
32
* @return The Flutter engine.
33
*/
34
@Nullable
35
FlutterEngine
provideFlutterEngine
(@NonNull Context context);
36
}
io.flutter.embedding.engine.FlutterEngine
Definition:
FlutterEngine.java:83
io.flutter.embedding.android.FlutterEngineProvider
Definition:
FlutterEngineProvider.java:22
io.flutter.embedding.android.FlutterEngineProvider.provideFlutterEngine
FlutterEngine provideFlutterEngine(@NonNull Context context)
android
Definition:
BitmapRegionDecoder.cpp:14
Generated on Sun Jun 23 2024 21:55:09 for Flutter Engine by
1.9.4