Class BackGestureChannel
java.lang.Object
io.flutter.embedding.engine.systemchannels.BackGestureChannel
A
MethodChannel
for communicating back gesture events to the Flutter framework.
The BackGestureChannel facilitates communication between the platform-specific Android back gesture handling code and the Flutter framework. It enables the dispatch of back gesture events such as start, progress, commit, and cancellation from the platform to the Flutter application.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionBackGestureChannel
(DartExecutor dartExecutor) Constructs a BackGestureChannel. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Cancels the back gesture event.void
Commits the back gesture event.void
Sets a method call handler for the channel.void
startBackGesture
(BackEvent backEvent) Initiates a back gesture event.void
updateBackGestureProgress
(BackEvent backEvent) Updates the progress of a back gesture event.
-
Field Details
-
channel
-
-
Constructor Details
-
BackGestureChannel
Constructs a BackGestureChannel.- Parameters:
dartExecutor
- The DartExecutor used to establish communication with the Flutter framework.
-
-
Method Details
-
startBackGesture
Initiates a back gesture event.This method should be called when the back gesture is initiated by the user.
- Parameters:
backEvent
- The BackEvent object containing information about the touch.
-
updateBackGestureProgress
Updates the progress of a back gesture event.This method should be called to update the progress of an ongoing back gesture event.
- Parameters:
backEvent
- An BackEvent object describing the progress event.
-
commitBackGesture
@RequiresApi(34) public void commitBackGesture()Commits the back gesture event.This method should be called to signify the completion of a back gesture event and commit the navigation action initiated by the gesture.
-
cancelBackGesture
@RequiresApi(34) public void cancelBackGesture()Cancels the back gesture event.This method should be called when a back gesture is cancelled or the back button is pressed.
-
setMethodCallHandler
Sets a method call handler for the channel.- Parameters:
handler
- The handler to set for the channel.
-