Interface PlatformViewsChannel2.PlatformViewsHandler
- Enclosing class:
PlatformViewsChannel2
public static interface PlatformViewsChannel2.PlatformViewsHandler
Handler that receives platform view messages sent from Flutter to Android through a given
PlatformViewsChannel.
To register a PlatformViewsHandler with a PlatformViewsChannel2, see PlatformViewsChannel2.setPlatformViewsHandler(PlatformViewsHandler).
-
Method Summary
Modifier and TypeMethodDescriptionvoidclearFocus(int viewId) Clears the focus from the platform view with a give id if it is currently focused.voidThe Flutter application would like to display a new AndroidView, i.e., platform view.voiddispose(int viewId) The Flutter application would like to dispose of an existing AndroidView.booleanWhether the SurfaceControl swapchain is enabled.default voidonRejectGesture(int viewId, long gestureId) Informs the handler that Flutter has won the gesture arena and rejected the platform view.voidonTouch(PlatformViewTouch touch) The user touched a platform view within Flutter.voidsetDirection(int viewId, int direction) The Flutter application would like to change the layout direction of an existing AndroidView, i.e., platform view.
-
Method Details
-
createPlatformView
The Flutter application would like to display a new AndroidView, i.e., platform view. -
dispose
void dispose(int viewId) The Flutter application would like to dispose of an existing AndroidView. -
onTouch
The user touched a platform view within Flutter.Touch data is reported in
touch. -
setDirection
void setDirection(int viewId, int direction) The Flutter application would like to change the layout direction of an existing AndroidView, i.e., platform view. -
clearFocus
void clearFocus(int viewId) Clears the focus from the platform view with a give id if it is currently focused. -
onRejectGesture
default void onRejectGesture(int viewId, long gestureId) Informs the handler that Flutter has won the gesture arena and rejected the platform view.- Parameters:
viewId- The ID of the platform view that was rejected.gestureId- The identifier (motionEventId / embedderId) of the specific gesture that was won by Flutter. If non-zero, this corresponds to the MotionEvent tracked by MotionEventTracker. If non-matching or zero, embedders safely fall back to standard buffered dispatch.
-
isSurfaceControlEnabled
boolean isSurfaceControlEnabled()Whether the SurfaceControl swapchain is enabled.
-