diff --git a/packages/flutter/lib/src/services/system_chrome.dart b/packages/flutter/lib/src/services/system_chrome.dart index a8bab279a8..03e4cdff22 100644 --- a/packages/flutter/lib/src/services/system_chrome.dart +++ b/packages/flutter/lib/src/services/system_chrome.dart @@ -72,7 +72,7 @@ class ApplicationSwitcherDescription { /// Specifies a system overlay at a particular location. /// -/// Used by [SystemChrome.setEnabledSystemUIOverlays]. +/// Used by [SystemChrome.setEnabledSystemUIMode]. enum SystemUiOverlay { /// The status bar provided by the embedder on the top of the application /// surface, if any. @@ -400,36 +400,6 @@ class SystemChrome { ); } - /// Specifies the set of system overlays to have visible when the application - /// is running. - /// - /// The `overlays` argument is a list of [SystemUiOverlay] enum values - /// denoting the overlays to show. - /// - /// If a particular overlay is unsupported on the platform, enabling or - /// disabling that overlay will be ignored. - /// - /// The settings here can be overridden by the platform when System UI becomes - /// necessary for functionality. - /// - /// For example, on Android, when the keyboard becomes visible, it will enable the - /// navigation bar and status bar system UI overlays. When the keyboard is closed, - /// Android will not restore the previous UI visibility settings, and the UI - /// visibility cannot be changed until 1 second after the keyboard is closed to - /// prevent malware locking users from navigation buttons. - /// - /// To regain "fullscreen" after text entry, the UI overlays should be set again - /// after a delay of 1 second. This can be achieved through [restoreSystemUIOverlays] - /// or calling this again. Otherwise, the original UI overlay settings will be - /// automatically restored only when the application loses and regains focus. - @Deprecated( - 'Migrate to setEnabledSystemUIMode. ' - 'This feature was deprecated after v2.3.0-17.0.pre.' - ) - static Future setEnabledSystemUIOverlays(List overlays) async { - await setEnabledSystemUIMode(SystemUiMode.manual, overlays: overlays); - } - /// Specifies the [SystemUiMode] to have visible when the application /// is running. /// @@ -508,7 +478,7 @@ class SystemChrome { } /// Restores the system overlays to the last settings provided via - /// [setEnabledSystemUIOverlays]. May be used when the platform force enables/disables + /// [setEnabledSystemUIMode]. May be used when the platform force enables/disables /// UI elements. /// /// For example, when the Android keyboard disables hidden status and navigation bars, diff --git a/packages/flutter/test/services/system_chrome_test.dart b/packages/flutter/test/services/system_chrome_test.dart index 4b2ae76d6c..3185752e59 100644 --- a/packages/flutter/test/services/system_chrome_test.dart +++ b/packages/flutter/test/services/system_chrome_test.dart @@ -120,23 +120,6 @@ void main() { expect(log, isNotEmpty); }); - test('setEnabledSystemUIOverlays control test', () async { - final List log = []; - - TestDefaultBinaryMessengerBinding.instance!.defaultBinaryMessenger.setMockMethodCallHandler(SystemChannels.platform, (MethodCall methodCall) async { - log.add(methodCall); - return null; - }); - - await SystemChrome.setEnabledSystemUIOverlays([SystemUiOverlay.top]); - - expect(log, hasLength(1)); - expect(log.single, isMethodCall( - 'SystemChrome.setEnabledSystemUIOverlays', - arguments: ['SystemUiOverlay.top'], - )); - }); - test('setEnabledSystemUIMode control test', () async { final List log = [];