Commit bf740cf4 authored by Adam Barth's avatar Adam Barth Committed by P.Y. Laligand

Restore SystemChrome.setEnabledSystemUIOverlays (#4680)

I erroneously removed this function in an earlier patch. Also, export
SystemUiOverlayStyle because we expose that enum in the SystemChrome
API.
parent 7c3a9435
...@@ -5,11 +5,13 @@ ...@@ -5,11 +5,13 @@
import 'dart:async'; import 'dart:async';
import 'package:sky_services/flutter/platform/system_chrome.mojom.dart' as mojom; import 'package:sky_services/flutter/platform/system_chrome.mojom.dart' as mojom;
import 'package:sky_services/flutter/platform/system_chrome.mojom.dart'; import 'package:sky_services/flutter/platform/system_chrome.mojom.dart'
show DeviceOrientation, SystemUiOverlay, SystemUiOverlayStyle;
import 'shell.dart'; import 'shell.dart';
export 'package:sky_services/flutter/platform/system_chrome.mojom.dart' show DeviceOrientation; export 'package:sky_services/flutter/platform/system_chrome.mojom.dart'
show DeviceOrientation, SystemUiOverlay, SystemUiOverlayStyle;
mojom.SystemChromeProxy _initSystemChromeProxy() { mojom.SystemChromeProxy _initSystemChromeProxy() {
return shell.connectToApplicationService('mojo:flutter_platform', mojom.SystemChrome.connectToService); return shell.connectToApplicationService('mojo:flutter_platform', mojom.SystemChrome.connectToService);
...@@ -65,6 +67,32 @@ class SystemChrome { ...@@ -65,6 +67,32 @@ class SystemChrome {
return completer.future; return completer.future;
} }
/// Specifies the set of overlays visible on the embedder when the
/// application is running. The embedder may choose to ignore unsupported
/// overlays
///
/// Arguments:
///
/// * [overlaysMask]: A mask of [SystemUiOverlay] enum values that denotes
/// the overlays to show.
///
/// Return Value:
///
/// boolean indicating if the preference was conveyed successfully to the
/// embedder.
///
/// Platform Specific Notes:
///
/// If the overlay is unsupported on the platform, enabling or disabling
/// that overlay is a no-op and always return true.
static Future<bool> setEnabledSystemUIOverlays(int overlaysMask) {
Completer<bool> completer = new Completer<bool>();
_systemChromeProxy.setEnabledSystemUiOverlays(overlaysMask, (bool success) {
completer.complete(success);
});
return completer.future;
}
/// Specifies the style of the system overlays that are visible on the /// Specifies the style of the system overlays that are visible on the
/// embedder (if any). The embedder may choose to ignore unsupported /// embedder (if any). The embedder may choose to ignore unsupported
/// overlays. /// overlays.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment