【问题标题】:I want to show the status bar with back color in my Flutter Application我想在我的 Flutter 应用程序中显示带有背景颜色的状态栏
【发布时间】:2021-01-20 05:40:12
【问题描述】:
import 'package:flutter/services.dart';

无效的主要(){ runApp(MyApp());

  SystemChrome.setEnabledSystemUIOverlays([SystemUiOverlay.bottom]);
}

我用它来隐藏状态栏现在我想要我的状态栏通过评论这个我没有恢复状态栏,我能做什么?

【问题讨论】:

  • 如果您正在使用Hot Reload 选项,请尝试stoprestart 应用程序,如果不起作用,请尝试flutter clean 并再次运行。

标签: android flutter show statusbar


【解决方案1】:
  SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
statusBarColor: Colors.transparent,
statusBarIconBrightness: Brightness.dark,

)); 通过使用这个我解决了问题

【讨论】:

    猜你喜欢
    • 2021-06-19
    • 1970-01-01
    • 1970-01-01
    • 2023-02-23
    • 2022-07-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多