Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
PluginRegistry.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
5package io.flutter.embedding.engine.plugins;
6
7import androidx.annotation.NonNull;
8import androidx.annotation.Nullable;
9import java.util.Set;
10
11public interface PluginRegistry {
12
13 /**
14 * Attaches the given {@code plugin} to the {@link io.flutter.embedding.engine.FlutterEngine}
15 * associated with this {@code PluginRegistry}.
16 */
17 void add(@NonNull FlutterPlugin plugin);
18
19 /**
20 * Attaches the given {@code plugins} to the {@link io.flutter.embedding.engine.FlutterEngine}
21 * associated with this {@code PluginRegistry}.
22 */
23 void add(@NonNull Set<FlutterPlugin> plugins);
24
25 /**
26 * Returns true if a plugin of the given type is currently attached to the {@link
27 * io.flutter.embedding.engine.FlutterEngine} associated with this {@code PluginRegistry}.
28 */
29 boolean has(@NonNull Class<? extends FlutterPlugin> pluginClass);
30
31 /**
32 * Returns the instance of a plugin that is currently attached to the {@link
33 * io.flutter.embedding.engine.FlutterEngine} associated with this {@code PluginRegistry}, which
34 * matches the given {@code pluginClass}.
35 *
36 * <p>If no matching plugin is found, {@code null} is returned.
37 */
38 @Nullable
39 FlutterPlugin get(@NonNull Class<? extends FlutterPlugin> pluginClass);
40
41 /**
42 * Detaches the plugin of the given type from the {@link
43 * io.flutter.embedding.engine.FlutterEngine} associated with this {@code PluginRegistry}.
44 *
45 * <p>If no such plugin exists, this method does nothing.
46 */
47 void remove(@NonNull Class<? extends FlutterPlugin> pluginClass);
48
49 /**
50 * Detaches the plugins of the given types from the {@link
51 * io.flutter.embedding.engine.FlutterEngine} associated with this {@code PluginRegistry}.
52 *
53 * <p>If no such plugins exist, this method does nothing.
54 */
55 void remove(@NonNull Set<Class<? extends FlutterPlugin>> plugins);
56
57 /**
58 * Detaches all plugins that are currently attached to the {@link
59 * io.flutter.embedding.engine.FlutterEngine} associated with this {@code PluginRegistry}.
60 *
61 * <p>If no plugins are currently attached, this method does nothing.
62 */
63 void removeAll();
64}
void add(@NonNull Set< FlutterPlugin > plugins)
boolean has(@NonNull Class<? extends FlutterPlugin > pluginClass)
void add(@NonNull FlutterPlugin plugin)