flutter / flutter_clock

BSD 3-Clause "New" or "Revised" License
543 stars 328 forks source link

How can I be notified of a theme change (e.g. light to dark)? #16

Closed ra9r closed 4 years ago

ra9r commented 4 years ago

The ClockModel currently has all the configuration options except the theme. What is the best practice for listening for a theme change in the ClockCustomizer?

edburtnieks-private commented 4 years ago

I think it's built inside flutter material package.

There is code snippet inside digital_clock.dart file which checks either it's light or dark theme:

final colors = Theme.of(context).brightness == Brightness.light ? _lightTheme : _darkTheme;

jkurtw commented 4 years ago

Thanks, @edburtnieks!

@ra9r I'll close this, but feel free to re-open if you still have issues.