如何将appBar颜色设置为真正的白色?

问题描述 投票:0回答:1

我希望我的应用栏是真正的白色,仍然使用材料 3 设计。 我尝试过使用

backGroundColor: Colors.white
在应用程序的 ThemeData 中或直接在小部件中。一切都没有改变。

这是我的代码:

  static ThemeData lightTheme = ThemeData(
    useMaterial3: true,
    brightness: Brightness.light,
    primaryColor: Colors.white,
    appBarTheme: const AppBarTheme(
      backgroundColor: Colors.white,
    ),
  );
}
return Scaffold(
       appBar: AppBar(
           elevation: 20,
           backgroundColor: Colors.white,
           title: Widget()
       )
      )

我不想要那种灰色。我只想要白色。

enter image description here

flutter themes appbar
1个回答
0
投票

使用

Color.fromRGBO(255,255,255,255)
。应该有效

© www.soinside.com 2019 - 2024. All rights reserved.