Specifies the style of the system overlays that are visible on the embedder (if any). The embedder may choose to ignore unsupported overlays.
This method will schedule the embedder update to be run in a microtask. Any subsequent calls to this method during the current event loop will overwrite the pending value to be set on the embedder.
Source
static void setSystemUIOverlayStyle(SystemUiOverlayStyle style) { assert(style != null); if (_pendingStyle != null) { // The microtask has already been queued; just update the pending value. _pendingStyle = style; return; } if (style == _latestStyle) { // Trivial success; no need to queue a microtask. return; } _pendingStyle = style; scheduleMicrotask(() { assert(_pendingStyle != null); if (_pendingStyle != _latestStyle) { PlatformMessages.invokeMethod( _kChannelName, 'SystemChrome.setSystemUIOverlayStyle', <String>[ _pendingStyle.toString() ], ); _latestStyle = _pendingStyle; } _pendingStyle = null; }); }