I'm trying to do an app with dynamic theme colors my idea is that when the user tap 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 , static variables.... but nothing works, any idea about how to do it ?
I want to put 3 diferent 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());
}
}