flutterthemesappbar

How to set the appBar color to be REALLY White?


I want my app bar to be really White, still using the material 3 design. I've tried to use backGroundColor: Colors.white either in the ThemeData of the app or directly in the widget. Nothing changes.

Here my code:

  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()
       )
      )

I don't want that Grey color. I just want the White.

enter image description here


Solution

  • I think when you remove the elevation and also set the tintColor to "white", this will give you white.