[Android] Update SystemUiMode and setSystemChromeEnabledSystemUIMode docs to note targeting Android 15+ change (#153466)

Updates `SystemUiMode` and `setSystemChromeEnabledSystemUIMode` documentation to reflect that edge-to-edge mode is used by default if the Flutter app targets Android 15.

Part of https://github.com/flutter/flutter/issues/150367 and framework counterpart to https://github.com/flutter/engine/pull/54560.
This commit is contained in:
Camille Simon 2024-09-25 12:41:18 -07:00 committed by GitHub
parent eb42a01302
commit 146ea07abd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -92,12 +92,21 @@ enum SystemUiOverlay {
/// These modes mimic Android-specific display setups.
///
/// Used by [SystemChrome.setEnabledSystemUIMode].
///
/// Flutter apps use [SystemUiMode.edgeToEdge] by default and setting any
/// of the other [SystemUiMode]s will NOT work unless you perform the migration
/// detailed in
/// https://docs.flutter.dev/release/breaking-changes/default-systemuimode-edge-to-edge.
enum SystemUiMode {
/// Fullscreen display with status and navigation bars presentable by tapping
/// anywhere on the display.
///
/// Available starting at SDK 16 or Android J. Earlier versions of Android
/// will not be affected by this setting.
/// Available starting at Android SDK 4.1 (API 16). Earlier versions of Android
/// will not be affected by this setting. However, if your app targets Android
/// SDK 15 (API 35) or later (Flutter does this by default), then you must
/// migrate using the instructions in
/// https://docs.flutter.dev/release/breaking-changes/default-systemuimode-edge-to-edge
/// to use this mode.
///
/// For applications running on iOS, the status bar and home indicator will be
/// hidden for a similar fullscreen experience.
@ -114,8 +123,12 @@ enum SystemUiMode {
/// Fullscreen display with status and navigation bars presentable through a
/// swipe gesture at the edges of the display.
///
/// Available starting at SDK 19 or Android K. Earlier versions of Android
/// will not be affected by this setting.
/// Available starting at Android SDK 4.4 (API 19). Earlier versions of
/// Android will not be affected by this setting. However, if your app targets
/// Android SDK 15 (API 35) or later (Flutter does this by default), then you
/// must migrate using the instructions in
/// https://docs.flutter.dev/release/breaking-changes/default-systemuimode-edge-to-edge
/// to use this mode.
///
/// For applications running on iOS, the status bar and home indicator will be
/// hidden for a similar fullscreen experience.
@ -133,8 +146,12 @@ enum SystemUiMode {
/// Fullscreen display with status and navigation bars presentable through a
/// swipe gesture at the edges of the display.
///
/// Available starting at SDK 19 or Android K. Earlier versions of Android
/// will not be affected by this setting.
/// Available starting at Android SDK 4.4 (API 19). Earlier versions of
/// Android will not be affected by this setting. However, if your app targets
/// Android SDK 15 (API 35) or later (Flutter does this by default), then you
/// must migrate using the instructions in
/// https://docs.flutter.dev/release/breaking-changes/default-systemuimode-edge-to-edge
/// to use this mode.
///
/// For applications running on iOS, the status bar and home indicator will be
/// hidden for a similar fullscreen experience.
@ -151,9 +168,13 @@ enum SystemUiMode {
/// Fullscreen display with status and navigation elements rendered over the
/// application.
///
/// Available starting at SDK 29 or Android 10. Earlier versions of Android
/// Available starting at Android SDK 10 (API 29). Earlier versions of Android
/// will not be affected by this setting.
///
/// If your app targets Android SDK 15 (API 35) or later (Flutter does this by
/// default), then this mode is used by default on Android. This mode is also
/// used by default on iOS.
///
/// For applications running on iOS, the status bar and home indicator will be
/// visible.
///
@ -181,6 +202,11 @@ enum SystemUiMode {
///
/// Omitting both overlays will result in the same configuration as
/// [SystemUiMode.leanBack].
///
/// If your app targets Android SDK 15 (API 35) or later, then you must
/// migrate using the instructions in
/// https://docs.flutter.dev/release/breaking-changes/default-systemuimode-edge-to-edge
/// to use this mode.
manual,
}
@ -502,6 +528,12 @@ abstract final class SystemChrome {
/// is true, the application is not fullscreen. See
/// [SystemChrome.setSystemUIChangeCallback] to respond to these changes in a
/// fullscreen application.
///
/// If your app targets Android SDK 15 (API 35) or later (Flutter does this by
/// default), then your Flutter app uses [SystemUiMode.edgeToEdge] by default
/// on Android and setting any of the other [SystemUiMode]s will NOT work
/// unless you perform the migration detailed in
/// https://docs.flutter.dev/release/breaking-changes/default-systemuimode-edge-to-edge.
static Future<void> setEnabledSystemUIMode(SystemUiMode mode, { List<SystemUiOverlay>? overlays }) async {
if (mode != SystemUiMode.manual) {
await SystemChannels.platform.invokeMethod<void>(