GestureNavigationDecorationFactory

Returns a AnimatedNavDecorator.Factory implementation which support navigation through appropriate gestures on certain platforms.

  • When running on Android 14 (or newer) devices, this decoration supports Android's 'predictive back gesture'.

  • When running on iOS, this decoration simulates iOS's 'interactive pop gesture'.

  • On other platforms, it defers to NavigatorDefaults.DefaultDecoration.

Parameters

fallback

The AnimatedNavDecorator.Factory which should be used when running on platforms which GestureNavigationDecorationFactory does not support.

listener

A GestureNavigationEventListener to observe the back gesture lifecycle, e.g. for analytics side effects. This is observational only, the Navigator still drives the pop.

expect fun GestureNavigationDecorationFactory(fallback: AnimatedNavDecorator.Factory = NavigatorDefaults.DefaultDecoratorFactory, listener: GestureNavigationEventListener = GestureNavigationEventListener.NoOp): AnimatedNavDecorator.Factory(source)

Returns a AnimatedNavDecorator.Factory implementation which support navigation through appropriate gestures on certain platforms.

  • When running on Android 14 (or newer) devices, this decoration supports Android's 'predictive back gesture'.

  • When running on iOS, this decoration simulates iOS's 'interactive pop gesture'.

  • On other platforms, it defers to NavigatorDefaults.DefaultDecoration.

Parameters

fallback

The AnimatedNavDecorator.Factory which should be used when running on platforms which GestureNavigationDecorationFactory does not support.

listener

A GestureNavigationEventListener to observe the back gesture lifecycle, e.g. for analytics side effects. This is observational only, the Navigator still drives the pop.

A factory that creates an IOSPredictiveBackNavDecorator for iOS predictive back navigation.

Return

An AnimatedNavDecorator.Factory that provides iOS predictive back navigation.

Parameters

fallback

The AnimatedNavDecorator.Factory to use when predictive back is not supported.

listener

A GestureNavigationEventListener to observe the back gesture lifecycle.

Returns a AnimatedNavDecorator.Factory implementation which support navigation through appropriate gestures on certain platforms.

  • When running on Android 14 (or newer) devices, this decoration supports Android's 'predictive back gesture'.

  • When running on iOS, this decoration simulates iOS's 'interactive pop gesture'.

  • On other platforms, it defers to NavigatorDefaults.DefaultDecoration.

Parameters

fallback

The AnimatedNavDecorator.Factory which should be used when running on platforms which GestureNavigationDecorationFactory does not support.

listener

A GestureNavigationEventListener to observe the back gesture lifecycle, e.g. for analytics side effects. This is observational only, the Navigator still drives the pop.

Returns a AnimatedNavDecorator.Factory implementation which support navigation through appropriate gestures on certain platforms.

  • When running on Android 14 (or newer) devices, this decoration supports Android's 'predictive back gesture'.

  • When running on iOS, this decoration simulates iOS's 'interactive pop gesture'.

  • On other platforms, it defers to NavigatorDefaults.DefaultDecoration.

Parameters

fallback

The AnimatedNavDecorator.Factory which should be used when running on platforms which GestureNavigationDecorationFactory does not support.

listener

A GestureNavigationEventListener to observe the back gesture lifecycle, e.g. for analytics side effects. This is observational only, the Navigator still drives the pop.