We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
My MyApp class
class MyApp extends StatelessWidget { // This widget is the root of your application. @override Widget build(BuildContext context) { return new DynamicTheme( defaultBrightness: Brightness.light, data: (brightness) => new ThemeData( brightness: brightness, ), themedWidgetBuilder: (context, theme) { return new MaterialApp( title: 'Omnibus', theme: theme, home: new SplashScreen( title: 'Omnibus', ), ); }, ); } }
How I'm changing the theme:
new IconButton( icon: new Icon(Icons.palette), color: Color.fromARGB(255, 15, 84, 108), onPressed: (){ DynamicTheme.of(context).setBrightness(Brightness.dark); DynamicTheme.of(context).setThemeData(new ThemeData( primaryColor: Color.fromARGB(255, 15, 84, 108), accentColor: Colors.yellow, )); } ),
The brightness is being changed properly, however the primary color or the accent color are not.
The text was updated successfully, but these errors were encountered:
The setBrightness is just a convenient method because it's the most common use case. Try this:
setBrightness
DynamicTheme.of(context).setThemeData(new ThemeData( brightness: Brightness.dark, primaryColor: Color.fromARGB(255, 15, 84, 108), accentColor: Colors.yellow, ));
Sorry, something went wrong.
Works perfectly, thank you!
No branches or pull requests
My MyApp class
How I'm changing the theme:
The brightness is being changed properly, however the primary color or the accent color are not.
The text was updated successfully, but these errors were encountered: