Declare your Color:
const primaryColor = Color(0xFF151026);
In the MaterialApp
level (will change the AppBar Color in the whole app ) change primaryColor
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primaryColor: primaryColor,
),
home: MyApp(),
);
and if you want to change it on the Widget level modify the backgroundColor
appBar: AppBar(
backgroundColor: primaryColor,
),
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…