Remove deprecated SystemChrome.setEnabledSystemUIOverlays (#119576)
This commit is contained in:
@@ -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<void> setEnabledSystemUIOverlays(List<SystemUiOverlay> 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,
|
||||
|
||||
@@ -120,23 +120,6 @@ void main() {
|
||||
expect(log, isNotEmpty);
|
||||
});
|
||||
|
||||
test('setEnabledSystemUIOverlays control test', () async {
|
||||
final List<MethodCall> log = <MethodCall>[];
|
||||
|
||||
TestDefaultBinaryMessengerBinding.instance!.defaultBinaryMessenger.setMockMethodCallHandler(SystemChannels.platform, (MethodCall methodCall) async {
|
||||
log.add(methodCall);
|
||||
return null;
|
||||
});
|
||||
|
||||
await SystemChrome.setEnabledSystemUIOverlays(<SystemUiOverlay>[SystemUiOverlay.top]);
|
||||
|
||||
expect(log, hasLength(1));
|
||||
expect(log.single, isMethodCall(
|
||||
'SystemChrome.setEnabledSystemUIOverlays',
|
||||
arguments: <String>['SystemUiOverlay.top'],
|
||||
));
|
||||
});
|
||||
|
||||
test('setEnabledSystemUIMode control test', () async {
|
||||
final List<MethodCall> log = <MethodCall>[];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user