如何在AppBar不存在时设置状态栏颜色.
我试过这个但没有用.
Widget build(BuildContext context) {
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.dark);
return new Scaffold(
body: new Container(
color: UniQueryColors.colorBackground,
child: new ListView.builder(
itemCount: 7,
itemBuilder: (BuildContext context, int index){
if (index == 0){
return addTopInfoSection();
}
},
),
),
);
}
Run Code Online (Sandbox Code Playgroud)
输出看起来像这样:
我对这一切都很陌生.我到处搜索,找到解决这个小问题的方法.有没有办法改变状态栏颜色?此外,当我使用颜色像colors.blue我可以看到状态栏中的文本质量不好.
谢谢
appBar: AppBar(
elevation : 0.0,
leading: IconButton(
icon: Icon(Icons.menu),
tooltip: 'Navigation menu',
onPressed: null,
),
actions: <Widget>[
IconButton(
icon: Icon(Icons.search),
tooltip: 'Search',
onPressed: null,
),
],
),
Run Code Online (Sandbox Code Playgroud) 如何使用Android Studios更改系统NavBar并且颤动?
我认为它不在main.dart中,我需要浏览android系统文件,但是当我尝试编辑style.xml时,主题编辑器却不允许我编辑任何颜色?
任何帮助将不胜感激,我想有一个轻型导航栏与轻型底部AppBar.
我尝试更改 safari 浏览器中的状态栏,我搜索了它,有很多关于它的问题,但没有一个解决我的问题。我尝试了change-status-bar-color和how-to-change-chrome-header-color。
这个蓝色区域位于 iPhone 的凹口周围,我想更改整个应用程序的颜色。
感谢您的关注。
如何在没有任何第三方插件的情况下更新状态栏图标的颜色?
在我的主题课程中,我有一个函数,我正在尝试下面的代码,但尚未实现结果:
目前的主题代码:
// custom light theme for app
static final customLightTheme = ThemeData.light().copyWith(
brightness: Brightness.light,
primaryColor: notWhite,
accentColor: Colors.amberAccent,
scaffoldBackgroundColor: notWhite,
primaryTextTheme: TextTheme(
title: TextStyle(
color: Colors.black
),
),
appBarTheme: AppBarTheme(
iconTheme: IconThemeData(color: Colors.black),
elevation: 0.0,
)
);
// custom dark theme for app
static final customDarkTheme = ThemeData.dark().copyWith(
brightness: Brightness.dark,
primaryColor: Colors.black,
accentColor: Colors.orange,
scaffoldBackgroundColor: Colors.black87,
primaryTextTheme: TextTheme(
title: TextStyle(
color: Colors.white
),
),
appBarTheme: AppBarTheme(
iconTheme: IconThemeData(color: Colors.white),
elevation: 0.0,
),
);
Run Code Online (Sandbox Code Playgroud)
主题更改代码:
// set theme for …Run Code Online (Sandbox Code Playgroud) 我想使用更改状态栏的颜色,我从这个答案AnnotatedRegion中得到了以下代码,但它对状态栏颜色没有影响。
AnnotatedRegion<SystemUiOverlayStyle>(
value: SystemUiOverlayStyle.light.copyWith(statusBarColor: Colors.white),
child: Scaffold(
appBar: AppBar(
title: Text('Annotated Region'),
),
body: Center(
child:
Text('Status Bar!'),
),
),
)
Run Code Online (Sandbox Code Playgroud)
要快速开始使用此代码,您可以使用此 Github 存储库。
Flutter 应用程序未显示状态栏 (PFA)。我不想全屏查看我的应用程序。有没有办法解决这个问题。
main.dart
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: '',
theme: ThemeData(
primarySwatch: Colors.purple,
fontFamily: 'FIRSNEUE'
),
home: SplashScreenFirst(),
routes: <String, WidgetBuilder> {
'/dashboard': (BuildContext context) => Dashboard(title: 'HOUSR'),
'/login': (BuildContext context) => Login(),
'/service-dashboard': (BuildContext context) => Service(),
'/service-exists': (BuildContext context) => ServiceExists(),
'/partnerOffers' : (BuildContext context) => Partner(),
'/visitorRequest' : (BuildContext context) => VisitorRequest(),
'/vistorRequestSuccess' : (BuildContext context) => VisitorRequestSuccess(),
'/mealPlan' …Run Code Online (Sandbox Code Playgroud) 我是 Flutter 新手,我用谷歌搜索了这个问题,但发现没有答案适合我。
我的代码如下所示,状态栏颜色效果很好,现在是白色的。但是Android上的状态栏文字颜色也是白色的,看起来Brightness.dark根本不起作用......
您的回答将不胜感激,谢谢!<3
Widget build(BuildContext context) {
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.dark.copyWith(
statusBarColor: Colors.white, // Color for Android
statusBarBrightness: Brightness.dark // Dark == white status bar -- for IOS.
));
return Scaffold(
body: Container(
...
}
Run Code Online (Sandbox Code Playgroud) Drawer我想知道如何更改打开时看到的最上面的颜色?
在下图中,您可以看到两个箭头,1 和 2。箭头 2 指向我的主屏幕,它是我的primaryColor,并且在除我的抽屉外的所有屏幕上正确显示。
我想要一个全白色的抽屉,并想去掉顶部的灰色。
我想根据移动设备中的深色模式和浅色模式更改 android 和 ios 本机启动屏幕中的状态栏颜色。使用生成的本机启动画面flutter_native_splash : ^2.2.0+1
我尝试了下面的方法,但在 android 的 res/night/styles.xml 中不起作用
<item name="android:statusBarColor">@android:color/white</item>
<item name="android:windowTranslucentNavigation">true</item>
<item name="android:windowLightStatusBar">true</item>
Run Code Online (Sandbox Code Playgroud)
我在 flutter 中使用应用程序栏的白色背景,如何将状态栏图标颜色更改为黑色,
我正在使用此代码来更改状态栏颜色,
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.dark.copyWith(
statusBarColor: Colors.white,
statusBarIconBrightness: Brightness.light,
));
Run Code Online (Sandbox Code Playgroud)