From de023bc6f451a01ddae909433ec02881e70a0348 Mon Sep 17 00:00:00 2001 From: Tan Jay Jun Date: Tue, 23 Jan 2018 03:08:17 +0800 Subject: [PATCH] Improve SystemChrome documentation (#14181) --- .../flutter/lib/src/services/system_chrome.dart | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/packages/flutter/lib/src/services/system_chrome.dart b/packages/flutter/lib/src/services/system_chrome.dart index 6795369630..f003fe0d83 100644 --- a/packages/flutter/lib/src/services/system_chrome.dart +++ b/packages/flutter/lib/src/services/system_chrome.dart @@ -157,8 +157,23 @@ class SystemChrome { /// system UI styles. For instance, to change the system UI style on a new /// page, consider calling when pushing/popping a new [PageRoute]. /// + /// However, the [AppBar] widget automatically sets the system overlay style + /// based on its [AppBar.brightness], so configure that instead of calling + /// this method directly. Likewise, do the same for [CupertinoNavigationBar] + /// via [CupertinoNavigationBar.backgroundColor]. + /// /// If a particular style is not supported on the platform, selecting it will /// have no effect. + /// + /// ## Sample Code + /// + /// ```dart + /// @override + /// Widget build(BuildContext context) { + /// SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.dark); + /// return /* ... */; + /// } + /// ``` static void setSystemUIOverlayStyle(SystemUiOverlayStyle style) { assert(style != null);