颤动中的状态栏颜色无法控制

问题描述

我尝试使用systemUIOverlayStyle更改我的应用程序的状态栏颜色,但没有任何改变。我也尝试过使用库和AnnotatedReagion小部件,但这是无法控制的。

@override
  Widget build(BuildContext context) {
    final themeColor = Provider.of<ThemeNotifier>(context);
    final direction = Provider.of<Direction>(context).getAppDirection();
    // FlutterStatusbarcolor.setStatusBarColor(Colors.transparent);
    // SystemChrome.setsystemUIOverlayStyle(systemUIOverlayStyle.light);
    SystemChrome.setsystemUIOverlayStyle(systemUIOverlayStyle(
        statusBarColor: Colors.blue,systemNavigationBarIconBrightness: Brightness.dark,statusBarIconBrightness: Brightness.dark,statusBarBrightness: Brightness.dark));
    return AnnotatedRegion<systemUIOverlayStyle>(
      value: systemUIOverlayStyle.light,child: SafeArea(
        child: Directionality(
          textDirection: direction,child: WillPopScope(
            // ignore: missing_return
            onWillPop: () {
              Nav.routeReplacement(context,SignUpPage());
            },child: Scaffold(
              resizetoAvoidBottomInset: false,// backgroundColor: Colors.white,appBar: AppBar(
                
                leading: Container(
                  width: 32,padding: const EdgeInsets.only(top: 8.0),child: IconButton(
                    icon: Icon(
                      Icons.chevron_left,color: themeColor.getColor(),size: 32,),onpressed: () {
                      Navigator.pop(context);
                      // Navigator.pushAndRemoveUntil(
                      //     context,//     MaterialPageRoute(builder: (context) => InitPage('')),//     (route) => false);
                    },backgroundColor: Color.fromARGB(255,252,252),elevation: 0,centerTitle: true,title: Text(
                  "nitrogen",style: GoogleFonts.poppins(
                    fontSize: 26,fontWeight: FontWeight.w600,body: SingleChildScrollView(
                child: Column(
                  mainAxisAlignment: MainAxisAlignment.spaceAround,children: <Widget>[
                    AuthHeader(
                      translate('login_page.login'),translate('login_page.existing'),LoginForm(),SizedBox(
                      height: 20,routeLoginWidget(themeColor,context,direction),],);
  }

我认为应用程序栏可能是造成此问题的原因,但是更改其颜色或将其完全删除后并不能解决任何问题。

有时它会闪烁为我设置的颜色,然后变为带有白色图标的完全白色或黑色背景。

有人可以告诉我我在做什么错吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)