Skip to content

Commit 780c9a8

Browse files
authored
Remove deprecated SystemChrome.setEnabledSystemUIOverlays (#119576)
1 parent b2e37c6 commit 780c9a8

File tree

2 files changed

+2
-49
lines changed

2 files changed

+2
-49
lines changed

packages/flutter/lib/src/services/system_chrome.dart

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class ApplicationSwitcherDescription {
7272

7373
/// Specifies a system overlay at a particular location.
7474
///
75-
/// Used by [SystemChrome.setEnabledSystemUIOverlays].
75+
/// Used by [SystemChrome.setEnabledSystemUIMode].
7676
enum SystemUiOverlay {
7777
/// The status bar provided by the embedder on the top of the application
7878
/// surface, if any.
@@ -400,36 +400,6 @@ class SystemChrome {
400400
);
401401
}
402402

403-
/// Specifies the set of system overlays to have visible when the application
404-
/// is running.
405-
///
406-
/// The `overlays` argument is a list of [SystemUiOverlay] enum values
407-
/// denoting the overlays to show.
408-
///
409-
/// If a particular overlay is unsupported on the platform, enabling or
410-
/// disabling that overlay will be ignored.
411-
///
412-
/// The settings here can be overridden by the platform when System UI becomes
413-
/// necessary for functionality.
414-
///
415-
/// For example, on Android, when the keyboard becomes visible, it will enable the
416-
/// navigation bar and status bar system UI overlays. When the keyboard is closed,
417-
/// Android will not restore the previous UI visibility settings, and the UI
418-
/// visibility cannot be changed until 1 second after the keyboard is closed to
419-
/// prevent malware locking users from navigation buttons.
420-
///
421-
/// To regain "fullscreen" after text entry, the UI overlays should be set again
422-
/// after a delay of 1 second. This can be achieved through [restoreSystemUIOverlays]
423-
/// or calling this again. Otherwise, the original UI overlay settings will be
424-
/// automatically restored only when the application loses and regains focus.
425-
@Deprecated(
426-
'Migrate to setEnabledSystemUIMode. '
427-
'This feature was deprecated after v2.3.0-17.0.pre.'
428-
)
429-
static Future<void> setEnabledSystemUIOverlays(List<SystemUiOverlay> overlays) async {
430-
await setEnabledSystemUIMode(SystemUiMode.manual, overlays: overlays);
431-
}
432-
433403
/// Specifies the [SystemUiMode] to have visible when the application
434404
/// is running.
435405
///
@@ -508,7 +478,7 @@ class SystemChrome {
508478
}
509479

510480
/// Restores the system overlays to the last settings provided via
511-
/// [setEnabledSystemUIOverlays]. May be used when the platform force enables/disables
481+
/// [setEnabledSystemUIMode]. May be used when the platform force enables/disables
512482
/// UI elements.
513483
///
514484
/// For example, when the Android keyboard disables hidden status and navigation bars,

packages/flutter/test/services/system_chrome_test.dart

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -120,23 +120,6 @@ void main() {
120120
expect(log, isNotEmpty);
121121
});
122122

123-
test('setEnabledSystemUIOverlays control test', () async {
124-
final List<MethodCall> log = <MethodCall>[];
125-
126-
TestDefaultBinaryMessengerBinding.instance!.defaultBinaryMessenger.setMockMethodCallHandler(SystemChannels.platform, (MethodCall methodCall) async {
127-
log.add(methodCall);
128-
return null;
129-
});
130-
131-
await SystemChrome.setEnabledSystemUIOverlays(<SystemUiOverlay>[SystemUiOverlay.top]);
132-
133-
expect(log, hasLength(1));
134-
expect(log.single, isMethodCall(
135-
'SystemChrome.setEnabledSystemUIOverlays',
136-
arguments: <String>['SystemUiOverlay.top'],
137-
));
138-
});
139-
140123
test('setEnabledSystemUIMode control test', () async {
141124
final List<MethodCall> log = <MethodCall>[];
142125

0 commit comments

Comments
 (0)