Unverified Commit 37c10acb authored by Gary Qian's avatar Gary Qian Committed by GitHub

Use 'Future<void>' insted of 'Future<Null>' in SystemChrome (#22583)

parent 8d76d37f
...@@ -237,7 +237,7 @@ class SystemChrome { ...@@ -237,7 +237,7 @@ class SystemChrome {
/// The `orientation` argument is a list of [DeviceOrientation] enum values. /// The `orientation` argument is a list of [DeviceOrientation] enum values.
/// The empty list causes the application to defer to the operating system /// The empty list causes the application to defer to the operating system
/// default. /// default.
static Future<Null> setPreferredOrientations(List<DeviceOrientation> orientations) async { static Future<void> setPreferredOrientations(List<DeviceOrientation> orientations) async {
await SystemChannels.platform.invokeMethod( await SystemChannels.platform.invokeMethod(
'SystemChrome.setPreferredOrientations', 'SystemChrome.setPreferredOrientations',
_stringify(orientations), _stringify(orientations),
...@@ -249,7 +249,7 @@ class SystemChrome { ...@@ -249,7 +249,7 @@ class SystemChrome {
/// ///
/// Any part of the description that is unsupported on the current platform /// Any part of the description that is unsupported on the current platform
/// will be ignored. /// will be ignored.
static Future<Null> setApplicationSwitcherDescription(ApplicationSwitcherDescription description) async { static Future<void> setApplicationSwitcherDescription(ApplicationSwitcherDescription description) async {
await SystemChannels.platform.invokeMethod( await SystemChannels.platform.invokeMethod(
'SystemChrome.setApplicationSwitcherDescription', 'SystemChrome.setApplicationSwitcherDescription',
<String, dynamic>{ <String, dynamic>{
...@@ -281,7 +281,7 @@ class SystemChrome { ...@@ -281,7 +281,7 @@ class SystemChrome {
/// after a delay of 1 second. This can be achieved through [restoreSystemUIOverlays] /// after a delay of 1 second. This can be achieved through [restoreSystemUIOverlays]
/// or calling this again. Otherwise, the original UI overlay settings will be /// or calling this again. Otherwise, the original UI overlay settings will be
/// automatically restored only when the application loses and regains focus. /// automatically restored only when the application loses and regains focus.
static Future<Null> setEnabledSystemUIOverlays(List<SystemUiOverlay> overlays) async { static Future<void> setEnabledSystemUIOverlays(List<SystemUiOverlay> overlays) async {
await SystemChannels.platform.invokeMethod( await SystemChannels.platform.invokeMethod(
'SystemChrome.setEnabledSystemUIOverlays', 'SystemChrome.setEnabledSystemUIOverlays',
_stringify(overlays), _stringify(overlays),
...@@ -297,7 +297,7 @@ class SystemChrome { ...@@ -297,7 +297,7 @@ class SystemChrome {
/// ///
/// On Android, the system UI cannot be changed until 1 second after the previous /// On Android, the system UI cannot be changed until 1 second after the previous
/// change. This is to prevent malware from permanently hiding navigation buttons. /// change. This is to prevent malware from permanently hiding navigation buttons.
static Future<Null> restoreSystemUIOverlays() async { static Future<void> restoreSystemUIOverlays() async {
await SystemChannels.platform.invokeMethod( await SystemChannels.platform.invokeMethod(
'SystemChrome.restoreSystemUIOverlays', 'SystemChrome.restoreSystemUIOverlays',
null, null,
......
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