Skip to content

Commit 8278868

Browse files
authored
1 parent 983235f commit 8278868

File tree

1 file changed

+39
-29
lines changed

1 file changed

+39
-29
lines changed

src/content/release/breaking-changes/default-systemuimode-edge-to-edge.md

Lines changed: 39 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,33 +7,39 @@ description: >-
77

88
{% render "docs/breaking-changes.md" %}
99

10-
:::note
11-
You might have found this page because you see a warning in the Google Play
12-
Console concerning "Edge-to-edge may not display for all users" or "Your app
13-
uses deprecated APIs or parameters for edge-to-edge".
14-
These warnings **will not** impact users.
15-
16-
This warning references deprecated code used in the Flutter engine to implement
17-
edge-to-edge mode. The engine relies on this deprecated code to avoid breaking
18-
changes for users, so it will continue to work should you set edge-to-edge
19-
mode in your app. See [flutter#169810] for more information.
20-
:::
21-
2210
## Summary
2311

12+
Edge-to-edge mode is Android's default display behavior as of
13+
Android version 15 and above. In Android 15, you could
14+
opt out of this behavior but, as of Android 16, you can't.
15+
To learn more about this change,
16+
check out the [Android 16 release notes][].
17+
18+
[Android 16 release notes]: {{site.android-dev}}/about/versions/16/behavior-changes-16#edge-to-edge
19+
20+
## Android 16 (or later)
21+
22+
Using the mechanism to opt out of edge-to-edge on Android 16
23+
or later might cause your app to crash, but you can avoid this
24+
by using version-specific resources; for details,
25+
visit the [migration guide](#migration-guide).
26+
27+
To learn how to structure your app to avoid this,
28+
we recommend that you visit the Leancode article, [Mastering Edge-To-Edge in Flutter:
29+
A Deep Dive Into the System Navigation Bar in Android][article].
30+
You can also find more discussion in [Issue 168635][] on GitHub.
31+
32+
[article]: https://leancode.co/blog/mastering-edge-to-edge-in-flutter
33+
[Issue 168635]: {{site.github}}/flutter/flutter/issues/168635#issuecomment-3485274018
34+
35+
## Android 15 (and below)
36+
2437
If your Flutter app targets Android SDK version 15,
2538
your app automatically displays in edge-to-edge mode,
2639
as documented on the [`SystemUiMode`][] API page.
27-
To maintain non-edge-to-edge app behavior
40+
To maintain non edge-to-edge app behavior
2841
(including an unset `SystemUiMode`),
29-
follow the steps in [migration guide](#migration-guide).
30-
31-
:::note
32-
If your Flutter app targets Android SDK version 16 or later,
33-
your app automatically displays in edge-to-edge mode, and you
34-
cannot opt-out. To learn more about this change, check out the
35-
[Android 16 release notes][].
36-
:::
42+
follow the steps in the [migration guide](#migration-guide).
3743

3844
[`SystemUiMode`]: {{site.api}}/flutter/services/SystemUiMode.html
3945

@@ -44,8 +50,8 @@ target Android 15 or later.
4450
To learn more about this change, check out the [Android 15 release notes][].
4551
This impacts devices running on Android SDK 15+ or API 35+.
4652

47-
Prior to Flutter 3.27, Flutter apps target Android 14 by default and
48-
won't opt into edge-to-edge mode automatically, but
53+
Prior to Flutter 3.27, Flutter apps targeted Android 14 by default and
54+
didn't opt into edge-to-edge mode automatically, but
4955
your app _will_ be impacted when you choose to target Android 15.
5056
If your app targets `flutter.targetSdkVersion` (as it does by default),
5157
then it targets Android 15 starting with Flutter version 3.27,
@@ -67,16 +73,14 @@ Be aware of the following:
6773

6874
[edge-to-edge mode]: {{site.android-dev}}/develop/ui/views/layout/edge-to-edge
6975
[Android 15 release notes]: {{site.android-dev}}/about/versions/15/behavior-changes-15#edge-to-edge
70-
[Android 16 release notes]: {{site.android-dev}}/about/versions/16/behavior-changes-16#edge-to-edge
7176
[`SystemChrome.setEnabledSystemUIMode`]: {{site.api}}/flutter/services/SystemChrome/setEnabledSystemUIMode.html
7277

7378
## Migration guide
7479

75-
To opt out of edge-to-edge on SDK 15, specify
76-
the new style attribute in each activity that requires it.
80+
To opt out of edge-to-edge on Android SDK 15,
81+
specify the new style attribute in each activity that requires it.
7782
If you have a parent style that child styles need to opt out of,
78-
you can modify the parent only.
79-
In the following example,
83+
you can modify the parent only. In the following example,
8084
update the style configuration generated from `flutter create`.
8185

8286
By default, the styles used in a Flutter app are set in
@@ -127,7 +131,13 @@ Ensure both styles are updated consistently in both files.
127131

128132
This modified style opts your app out of edge-to-edge for
129133
apps targeting Android SDK 15.
130-
So now you're done!
134+
135+
:::note
136+
If your app runs on Android 16 or above, to avoid crashes you can
137+
create a `your_app/android/app/src/main/res/values-35` resource
138+
directory that contains styles without the
139+
`android:windowOptOutEdgeToEdgeEnforcement` attribute.
140+
:::
131141

132142
## Timeline
133143

0 commit comments

Comments
 (0)