I am using flutter 2.8.0
to create a simple app.
But when I am trying to change the primary color for the App it does not work with me.
This is the code I am working on:
class BMICalculator extends StatelessWidget {
const BMICalculator({Key? key}) : super(key: key);
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData.dark().copyWith(
primaryColor: const Color(0xFF0A0E21),
scaffoldBackgroundColor: const Color(0xFF0A0E21),
),
home: const InputPage(),
);
}
}
CodePudding user response:
Use primarySwatch
theme: ThemeData(
primarySwatch: Colors.red,
),
CodePudding user response:
@Mrinal already mentioned you to use primarySwatch. Flutter team intended to build
For more read this article article