Flutter Change Button Style on Theme Change

Опубликовано: 28 Сентябрь 2024
на канале: Andy Wong
48
1

Q: How do I set multiple button color styles for dark theme in Flutter? For example, when in dark mode I need three different color buttons and also for light mode.

A: 2 StackOverflow Q & A

// StackOverflow CC SA 4.0
// button Style
https://stackoverflow.com/questions/6... Asad Malik
// theme change
https://stackoverflow.com/questions/6... Silent Fairy

________________
A: MyTheme (Static class)
B: Notification Object, class ThemeProvider extends ChangeNotifier
C: Glue "IT" together

________________

B: need 1 flag, isDarkMode (trigger refresh)
....


A: pm mode change get the "Style"-thing

...



C: See the. video