Interface PlatformChannel.PlatformMessageHandler
- Enclosing class:
- PlatformChannel
PlatformChannel.
To register a PlatformMessageHandler with a PlatformChannel, see PlatformChannel.setPlatformMessageHandler(PlatformMessageHandler).
-
Method Summary
Modifier and TypeMethodDescriptionbooleanThe Flutter application would like to know if the clipboard currently contains a string that can be pasted.The Flutter application would like to receive the current data in the clipboard and have it returned in the givenformat.voidplaySystemSound(PlatformChannel.SoundType soundType) The Flutter application would like to play the givensoundType.voidThe Flutter application would like to pop the top item off of the Android app's navigation back stack.voidThe Flutter application would like to restore the visibility of system overlays to the last set of overlays sent viashowSystemOverlays(List)orshowSystemUiMode(SystemUiMode).voidThe Flutter application would like to be displayed in Android's app switcher with the visual representation described in the givendescription.voidsetClipboardData(String text) The Flutter application would like to set the current data in the clipboard to the giventext.default voidsetFrameworkHandlesBack(boolean frameworkHandlesBack) The Flutter application would or would not like to handle navigation pop events itself.voidsetPreferredOrientations(int androidOrientation) The Flutter application would like to display in the givenandroidOrientation.voidThe Flutter application would like the Android system to notify the framework when the system ui visibility has changed.voidsetSystemUiOverlayStyle(PlatformChannel.SystemChromeStyle systemUiOverlayStyle) The Flutter application would like the system chrome to present itself with the givensystemUiOverlayStyle, i.e., the given status bar and navigation bar colors and brightness.voidThe Flutter application would like to share the giventextusing the Android standard intent action namedIntent.ACTION_SEND.voidThe Flutter application would like the Android system to display the givenoverlays.voidThe Flutter application would like the Android system to display the givenmode.voidvibrateHapticFeedback(PlatformChannel.HapticFeedbackType feedbackType) The Flutter application would like to play the given hapticfeedbackType.
-
Method Details
-
playSystemSound
The Flutter application would like to play the givensoundType. -
vibrateHapticFeedback
The Flutter application would like to play the given hapticfeedbackType. -
setPreferredOrientations
void setPreferredOrientations(int androidOrientation) The Flutter application would like to display in the givenandroidOrientation. -
setApplicationSwitcherDescription
The Flutter application would like to be displayed in Android's app switcher with the visual representation described in the givendescription.See the related Android documentation: https://developer.android.com/guide/components/activities/recents
-
showSystemOverlays
The Flutter application would like the Android system to display the givenoverlays.PlatformChannel.SystemUiOverlay.TOP_OVERLAYSrefers to system overlays such as the status bar, whilePlatformChannel.SystemUiOverlay.BOTTOM_OVERLAYSrefers to system overlays such as the back/home/recents navigation on the bottom of the screen.An empty list of
overlaysshould hide all system overlays. -
showSystemUiMode
The Flutter application would like the Android system to display the givenmode.PlatformChannel.SystemUiMode.LEAN_BACKrefers to a fullscreen experience that restores system bars upon tapping anywhere in the application. This tap gesture is not received by the application.PlatformChannel.SystemUiMode.IMMERSIVErefers to a fullscreen experience that restores system bars upon swiping from the edge of the viewport. This swipe gesture is not recived by the application.PlatformChannel.SystemUiMode.IMMERSIVE_STICKYrefers to a fullscreen experience that restores system bars upon swiping from the edge of the viewport. This swipe gesture is received by the application, in contrast toPlatformChannel.SystemUiMode.IMMERSIVE.PlatformChannel.SystemUiMode.EDGE_TO_EDGErefers to a layout configuration that will consume the full viewport. This full screen experience does not hide status bars. These status bars can be set to transparent, making the buttons and icons hover over the fullscreen application. -
setSystemUiChangeListener
void setSystemUiChangeListener()The Flutter application would like the Android system to notify the framework when the system ui visibility has changed.This is relevant when using
PlatformChannel.SystemUiModes for fullscreen applications, from which the system overlays can appear or disappear based on user input. -
restoreSystemUiOverlays
void restoreSystemUiOverlays()The Flutter application would like to restore the visibility of system overlays to the last set of overlays sent viashowSystemOverlays(List)orshowSystemUiMode(SystemUiMode).If
showSystemOverlays(List)orshowSystemUiMode(SystemUiMode)has yet to be called, then a default system overlay appearance is desired:View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN -
setSystemUiOverlayStyle
The Flutter application would like the system chrome to present itself with the givensystemUiOverlayStyle, i.e., the given status bar and navigation bar colors and brightness. -
setFrameworkHandlesBack
default void setFrameworkHandlesBack(boolean frameworkHandlesBack) The Flutter application would or would not like to handle navigation pop events itself.Relevant for registering and unregistering the app's OnBackInvokedCallback for the Predictive Back feature, for example as in
FlutterActivity. -
getClipboardData
The Flutter application would like to receive the current data in the clipboard and have it returned in the givenformat. -
setClipboardData
The Flutter application would like to set the current data in the clipboard to the giventext. -
clipboardHasStrings
boolean clipboardHasStrings()The Flutter application would like to know if the clipboard currently contains a string that can be pasted.
-