Package io.flutter.embedding.engine.systemchannels

# Class BackGestureChannel

java.lang.Object
io.flutter.embedding.engine.systemchannels.BackGestureChannel

public class BackGestureChannel extends Object
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

  Fields
  Modifier and Type
  Field
  Description
  `final MethodChannel`
  `channel`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `BackGestureChannel(DartExecutor dartExecutor)`
  Constructs a BackGestureChannel.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `cancelBackGesture()`
  Cancels the back gesture event.
  `void`
  `commitBackGesture()`
  Commits the back gesture event.
  `void`
  `setMethodCallHandler(MethodChannel.MethodCallHandler handler)`
  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.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### channel

    @NonNull public final MethodChannel channel

- ## Constructor Details

  - ### BackGestureChannel

    public BackGestureChannel(@NonNull DartExecutor dartExecutor)
    Constructs a BackGestureChannel.
    Parameters:
      `dartExecutor` - The DartExecutor used to establish communication with the Flutter framework.

- ## Method Details

  - ### startBackGesture

    @RequiresApi(34) public void startBackGesture(@NonNull BackEvent backEvent)
    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

    @RequiresApi(34) public void updateBackGestureProgress(@NonNull BackEvent backEvent)
    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

    public void setMethodCallHandler(@Nullable MethodChannel.MethodCallHandler handler)
    Sets a method call handler for the channel.
    Parameters:
      `handler` - The handler to set for the channel.