SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.light);
由于我设置了导航栏透明,导致状态栏的文字颜色变成了白色,通过这句就可以将字体改为黑色
@override
Widgetbuild (BuildContext context){
//设置状态栏字体为黑色(由于导航栏设为透明导致,状态栏字体变白色)
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.light);
return Scaffold(
extendBodyBehindAppBar:true,//布局从状态栏开始
appBar:AppBar(
elevation:0.0,//去掉导航默认阴影
backgroundColor: Colors.transparent,//设置导航栏透明
title:Text('关于我们',style:TextStyle(fontSize:17,fontWeight: FontWeight.bold,color: Colors.black)),
leading:IconButton(
onPressed: (){
Navigator.pop(context);
},
icon:Image.asset('images/backIcon.png',width:20,height:20),
), systemOverlayStyle: SystemUiOverlayStyle.dark,
),
网友评论