I'm trying to do an app with dynamic theme colors my idea is that when the user taps one button some parts of the app (buttons, appbar, themeData...) will change. But I'm not sure how to do it, I tried with some if conditions, and static variables.... but nothing works, any idea about how to do it?
I want to put 3 different themes for the app and here is the main file where I put the theme of the app:
void main() {
runApp(CharlotApp());
}
class CharlotApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Fluttter colors',
theme: ThemeData(
primaryColor: MyTheme.kPrimaryColor,
accentColor: MyTheme.kAccentColor,
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: SplashScreen());
}
}