ThemeController constructor

ThemeController(
  1. SettingsStore _settings, {
  2. required bool prefersDark(),
  3. void onApply(
    1. ResolvedTheme theme
    )?,
})

Creates a controller, restoring the persisted preference from settings.

Implementation

ThemeController(this._settings, {required this.prefersDark, this.onApply})
  : mode = Observable(ThemeMode.parse(_settings.theme)) {
  _applyNow();
}