美文网首页
flutter 修改安卓物理键背景颜色等,SystemUiOve

flutter 修改安卓物理键背景颜色等,SystemUiOve

作者: Dove_iOS | 来源:发表于2022-04-20 20:10 被阅读0次
    
      SystemUiOverlayStyle systemUiOverlayStyle =
      const SystemUiOverlayStyle(
        statusBarColor: Colors.transparent,//状态栏
        systemNavigationBarColor:Color(0xffffffff),//虚拟按键背景色
        systemNavigationBarDividerColor: Colors.transparent,
        systemNavigationBarIconBrightness: Brightness.dark,//虚拟按键图标色
        statusBarIconBrightness: Brightness.light,
        statusBarBrightness: Brightness.light,
      );
      SystemChrome.setSystemUIOverlayStyle(systemUiOverlayStyle);
    

    放在 main(){}最后面

    在页面 里也可以修改

    
      @override
      Widget build(BuildContext context) {
      SystemUiOverlayStyle systemUiOverlayStyle =
      const SystemUiOverlayStyle(
        statusBarColor: Colors.transparent,//状态栏
        systemNavigationBarColor:Color(0xffffffff),//虚拟按键背景色
        systemNavigationBarDividerColor: Colors.transparent,
        systemNavigationBarIconBrightness: Brightness.dark,//虚拟按键图标色
        statusBarIconBrightness: Brightness.light,
        statusBarBrightness: Brightness.light,
      );
    
        return AnnotatedRegion<SystemUiOverlayStyle>(
          value: systemUiOverlayStyle, //SystemUiOverlayStyle.dark,
          child: ..., //getBody
        );
      }
    
    

    相关文章

      网友评论

          本文标题:flutter 修改安卓物理键背景颜色等,SystemUiOve

          本文链接:https://www.haomeiwen.com/subject/osfbertx.html