flutter / flutter/website

Predictive back docs should be updated when made default

Open
#12,201 2 comments 1 reaction 1 assignee Claimed by @lamek View on GitHub
e1-hours from.page-issue p2-medium
Dominant language
Dart
Stars
3.1k
Forks
3.5k
Avg merge
2d 2h
Merged PRs (30d)
96

Description

### Page URL

https://docs.flutter.dev/platform-integration/android/predictive-back

### Page source

https://github.com/flutter/website/blob/main/src/content/platform-integration/android/predictive-back.md

### Describe the problem

Predictive back currently requires some setup, but soon it will be turned on by default (https://github.com/flutter/flutter/pull/165832) and that will change. When that PR lands, these docs will need to be updated.

### Expected fix

```diff
Configure your device
- You need to enable Developer Mode and set a flag on your device, so you can't yet expect predictive back to - work on most users' Android devices. If you want to try it out on your own device though, make sure it's running API 33 or higher, and then in Settings => System => Developer options, make sure the switch is enabled next to Predictive back animations.
+ Devices running Android 16 and above require no configuration.
+ Devices running Android 13, 14, and 15 must enable Developer Mode and set the "Predictive back animations" flag in Settings => System => Developer.
+ Devices running older versions of Android are not supported and will fall back to the [Fade Forwards transition](https://main-api.flutter.dev/flutter/material/FadeForwardsPageTransitionsBuilder-class.html).

- Set up your app
- The predictive back route transitions are currently not enabled by default, so for now you'll need to enable them manually in your app. Typically, you do this by setting them in your theme:
+ The predictive back route transition (`PredictiveBackPageTransitionsBuilder`) is the default on Android Flutter apps, so if you haven't customized your app's route transitions, you'll get predictive back out of the box.

- MaterialApp(
- theme: ThemeData(
- pageTransitionsTheme: const PageTransitionsTheme(
- builders: {
- // Set the predictive back transitions for Android.
- TargetPlatform.android: PredictiveBackPageTransitionsBuilder(),
- },
- ),
- ),
- ...
- ),
```

### Additional context

_No response_

### I would like to fix this problem.

- [ ] I will try and fix this problem on docs.flutter.dev.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.