setFrameworkHandlesBack static method

Future<void> setFrameworkHandlesBack(
  1. bool frameworkHandlesBack
)

Informs the platform of whether or not the Flutter framework will handle back events.

Currently, this is used only on Android to inform its use of the predictive back gesture when exiting the app. When true, predictive back is disabled.

See also:

Implementation

static Future<void> setFrameworkHandlesBack(bool frameworkHandlesBack) async {
  // Currently, this method call is only relevant on Android.
  if (kIsWeb) {
    return;
  }
  switch (defaultTargetPlatform) {
    case TargetPlatform.iOS:
    case TargetPlatform.macOS:
    case TargetPlatform.fuchsia:
    case TargetPlatform.linux:
    case TargetPlatform.windows:
      return;
    case TargetPlatform.android:
      return SystemChannels.platform.invokeMethod<void>(
        'SystemNavigator.setFrameworkHandlesBack',
        frameworkHandlesBack,
      );
  }
}