How to make Android status bar light in Flutter

后端 未结 2 1745
温柔的废话
温柔的废话 2021-01-02 06:18

As the title suggests, this is about Flutter.

Is there any way to switch Android status bar to light mode so that the icons in status bar show up dark? See picture f

相关标签:
2条回答
  • 2021-01-02 06:46

    Just additional notes:

    To change the status bar icon to dark put the following code

    StatusBarIconBrightness: Brightness.light
    

    and add brightness in appbar.

    appBar: AppBar(  
    brightness: Brightness.light, )
    

    if you would like to use white bg on status bar, then change to .light so that icon can be dark, and .dark for darker status bar with white icon

    0 讨论(0)
  • 2021-01-02 06:48

    The Flutter team have now added support for light/dark status bar control. To add, import this:

    import 'package:flutter/services.dart';
    

    Then add this in your App's build function:

    SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.dark.copyWith(
      statusBarIconBrightness: Brightness.dark
    ));
    
    0 讨论(0)
提交回复
热议问题