Flutter Engine
The Flutter Engine
Classes | Public Member Functions | Package Functions | List of all members
io.flutter.app.FlutterPluginRegistry Class Reference
Inheritance diagram for io.flutter.app.FlutterPluginRegistry:
io.flutter.plugin.common.PluginRegistry io.flutter.plugin.common.PluginRegistry.RequestPermissionsResultListener io.flutter.plugin.common.PluginRegistry.ActivityResultListener io.flutter.plugin.common.PluginRegistry.NewIntentListener io.flutter.plugin.common.PluginRegistry.WindowFocusChangedListener io.flutter.plugin.common.PluginRegistry.UserLeaveHintListener io.flutter.plugin.common.PluginRegistry.ViewDestroyListener

Public Member Functions

 FlutterPluginRegistry (FlutterNativeView nativeView, Context context)
 
 FlutterPluginRegistry (FlutterEngine engine, Context context)
 
boolean hasPlugin (String key)
 
Registrar registrarFor (String pluginKey)
 
void attach (FlutterView flutterView, Activity activity)
 
void detach ()
 
void onPreEngineRestart ()
 
PlatformViewsController getPlatformViewsController ()
 
boolean onRequestPermissionsResult (int requestCode, String[] permissions, int[] grantResults)
 
boolean onActivityResult (int requestCode, int resultCode, Intent data)
 
boolean onNewIntent (Intent intent)
 
void onUserLeaveHint ()
 
void onWindowFocusChanged (boolean hasFocus)
 
boolean onViewDestroy (FlutterNativeView view)
 
void destroy ()
 
- Public Member Functions inherited from io.flutter.plugin.common.PluginRegistry
Registrar registrarFor (@NonNull String pluginKey)
 
boolean hasPlugin (@NonNull String pluginKey)
 
< T > T valuePublishedByPlugin (@NonNull String pluginKey)
 
- Public Member Functions inherited from io.flutter.plugin.common.PluginRegistry.RequestPermissionsResultListener
boolean onRequestPermissionsResult (int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults)
 
- Public Member Functions inherited from io.flutter.plugin.common.PluginRegistry.ActivityResultListener
boolean onActivityResult (int requestCode, int resultCode, @Nullable Intent data)
 
- Public Member Functions inherited from io.flutter.plugin.common.PluginRegistry.NewIntentListener
boolean onNewIntent (@NonNull Intent intent)
 
void onWindowFocusChanged (boolean hasFocus)
 
void onUserLeaveHint ()
 
- Public Member Functions inherited from io.flutter.plugin.common.PluginRegistry.ViewDestroyListener
boolean onViewDestroy (@NonNull FlutterNativeView view)
 

Package Functions

public< T > T valuePublishedByPlugin (String pluginKey)
 

Detailed Description

Deprecated:
See https://flutter.dev/go/android-project-migration for migration instructions.

Definition at line 26 of file FlutterPluginRegistry.java.

Constructor & Destructor Documentation

◆ FlutterPluginRegistry() [1/2]

io.flutter.app.FlutterPluginRegistry.FlutterPluginRegistry ( FlutterNativeView  nativeView,
Context  context 
)
inline

Definition at line 51 of file FlutterPluginRegistry.java.

51 {
52 mNativeView = nativeView;
53 mAppContext = context;
54 mPlatformViewsController = new PlatformViewsController();
55 }

◆ FlutterPluginRegistry() [2/2]

io.flutter.app.FlutterPluginRegistry.FlutterPluginRegistry ( FlutterEngine  engine,
Context  context 
)
inline

Definition at line 57 of file FlutterPluginRegistry.java.

57 {
58 // TODO(mattcarroll): implement use of engine instead of nativeView.
59 mAppContext = context;
60 mPlatformViewsController = new PlatformViewsController();
61 }

Member Function Documentation

◆ attach()

void io.flutter.app.FlutterPluginRegistry.attach ( FlutterView  flutterView,
Activity  activity 
)
inline

Definition at line 83 of file FlutterPluginRegistry.java.

83 {
84 mFlutterView = flutterView;
85 mActivity = activity;
86 mPlatformViewsController.attach(activity, flutterView, flutterView.getDartExecutor());
87 }
void attach( @Nullable Context context, @NonNull TextureRegistry textureRegistry, @NonNull DartExecutor dartExecutor)

◆ destroy()

void io.flutter.app.FlutterPluginRegistry.destroy ( )
inline

Definition at line 256 of file FlutterPluginRegistry.java.

256 {
257 mPlatformViewsController.onDetachedFromJNI();
258 }

◆ detach()

void io.flutter.app.FlutterPluginRegistry.detach ( )
inline

Definition at line 89 of file FlutterPluginRegistry.java.

89 {
90 mPlatformViewsController.detach();
91 mPlatformViewsController.onDetachedFromJNI();
92 mFlutterView = null;
93 mActivity = null;
94 }

◆ getPlatformViewsController()

PlatformViewsController io.flutter.app.FlutterPluginRegistry.getPlatformViewsController ( )
inline

Definition at line 100 of file FlutterPluginRegistry.java.

100 {
101 return mPlatformViewsController;
102 }

◆ hasPlugin()

boolean io.flutter.app.FlutterPluginRegistry.hasPlugin ( String  key)
inline

Definition at line 64 of file FlutterPluginRegistry.java.

64 {
65 return mPluginMap.containsKey(key);
66 }

◆ onActivityResult()

boolean io.flutter.app.FlutterPluginRegistry.onActivityResult ( int  requestCode,
int  resultCode,
Intent  data 
)
inline

Definition at line 212 of file FlutterPluginRegistry.java.

212 {
213 for (ActivityResultListener listener : mActivityResultListeners) {
214 if (listener.onActivityResult(requestCode, resultCode, data)) {
215 return true;
216 }
217 }
218 return false;
219 }
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:63

◆ onNewIntent()

boolean io.flutter.app.FlutterPluginRegistry.onNewIntent ( Intent  intent)
inline

Definition at line 222 of file FlutterPluginRegistry.java.

222 {
223 for (NewIntentListener listener : mNewIntentListeners) {
224 if (listener.onNewIntent(intent)) {
225 return true;
226 }
227 }
228 return false;
229 }

◆ onPreEngineRestart()

void io.flutter.app.FlutterPluginRegistry.onPreEngineRestart ( )
inline

Definition at line 96 of file FlutterPluginRegistry.java.

96 {
97 mPlatformViewsController.onPreEngineRestart();
98 }

◆ onRequestPermissionsResult()

boolean io.flutter.app.FlutterPluginRegistry.onRequestPermissionsResult ( int  requestCode,
String[]  permissions,
int[]  grantResults 
)
inline

Definition at line 201 of file FlutterPluginRegistry.java.

202 {
203 for (RequestPermissionsResultListener listener : mRequestPermissionsResultListeners) {
204 if (listener.onRequestPermissionsResult(requestCode, permissions, grantResults)) {
205 return true;
206 }
207 }
208 return false;
209 }

◆ onUserLeaveHint()

void io.flutter.app.FlutterPluginRegistry.onUserLeaveHint ( )
inline

Implements io.flutter.plugin.common.PluginRegistry.UserLeaveHintListener.

Definition at line 232 of file FlutterPluginRegistry.java.

232 {
233 for (UserLeaveHintListener listener : mUserLeaveHintListeners) {
234 listener.onUserLeaveHint();
235 }
236 }

◆ onViewDestroy()

boolean io.flutter.app.FlutterPluginRegistry.onViewDestroy ( FlutterNativeView  view)
inline

Definition at line 246 of file FlutterPluginRegistry.java.

246 {
247 boolean handled = false;
248 for (ViewDestroyListener listener : mViewDestroyListeners) {
249 if (listener.onViewDestroy(view)) {
250 handled = true;
251 }
252 }
253 return handled;
254 }

◆ onWindowFocusChanged()

void io.flutter.app.FlutterPluginRegistry.onWindowFocusChanged ( boolean  hasFocus)
inline

Implements io.flutter.plugin.common.PluginRegistry.WindowFocusChangedListener.

Definition at line 239 of file FlutterPluginRegistry.java.

239 {
240 for (WindowFocusChangedListener listener : mWindowFocusChangedListeners) {
241 listener.onWindowFocusChanged(hasFocus);
242 }
243 }

◆ registrarFor()

Registrar io.flutter.app.FlutterPluginRegistry.registrarFor ( String  pluginKey)
inline

Definition at line 75 of file FlutterPluginRegistry.java.

75 {
76 if (mPluginMap.containsKey(pluginKey)) {
77 throw new IllegalStateException("Plugin key " + pluginKey + " is already in use");
78 }
79 mPluginMap.put(pluginKey, null);
80 return new FlutterRegistrar(pluginKey);
81 }

◆ valuePublishedByPlugin()

public< T > T io.flutter.app.FlutterPluginRegistry.valuePublishedByPlugin ( String  pluginKey)
inlinepackage

Definition at line 70 of file FlutterPluginRegistry.java.

70 {
71 return (T) mPluginMap.get(pluginKey);
72 }
#define T
Definition: precompiler.cc:65

The documentation for this class was generated from the following file: