状态栏中图标的颜色(颤动) [英] Icon's color in status bar (Flutter)

查看:101
本文介绍了状态栏中图标的颜色(颤动)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用FLUTTER,状态栏
的设计指的是黑色,状态栏的图标颜色必须是白色的
,所以如何在抖动中更改状态栏图标的颜色? / p>

I was working with FLUTTER and the Design refers to black color for the status bar and the icon's color of the status bar must be white so how can I change statusbar icon's color in flutter?

推荐答案

将以下代码段添加到您的 main.dart 中。 setSystemUIOverlayStyle 允许更改系统覆盖样式(如果有)。

Add the Snippet below to your main.dart. setSystemUIOverlayStyle allows one to change System overlay styles if any. This will do the job globally in your app.

SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
statusBarColor: Colors.transparent,
statusBarIconBrightness: Brightness.dark));

这将为您带来以下效果(iOS和Android)。玩弄 SystemUiOverlayStyle 中的属性以获取所需的内容。

This will give you the effect below(iOS & Android). Play around with the properties in SystemUiOverlayStyle to get what you want.

这篇关于状态栏中图标的颜色(颤动)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆