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


  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(
      value: systemUiOverlayStyle, //SystemUiOverlayStyle.dark,
      child: ..., //getBody
    );
  }

你可能感兴趣的:(flutter 修改安卓物理键背景颜色等,SystemUiOverlayStyle)