mirror of
https://github.com/hanskokx/arcane_framework.git
synced 2026-05-14 10:29:06 +02:00
ArcaneReactiveTheme now optionally takes a ThemeMode parameter when calling switchTheme
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
@@ -52,10 +52,15 @@ class ArcaneReactiveTheme extends ArcaneService {
|
||||
/// ```dart
|
||||
/// ArcaneReactiveTheme.I.switchTheme();
|
||||
/// ```
|
||||
ArcaneReactiveTheme switchTheme() {
|
||||
_systemThemeNotifier.value = _systemThemeNotifier.value == ThemeMode.light
|
||||
? ThemeMode.dark
|
||||
: ThemeMode.light;
|
||||
ArcaneReactiveTheme switchTheme({ThemeMode? themeMode}) {
|
||||
if (themeMode != null) {
|
||||
_systemThemeNotifier.value = themeMode;
|
||||
} else {
|
||||
_systemThemeNotifier.value = _systemThemeNotifier.value == ThemeMode.light
|
||||
? ThemeMode.dark
|
||||
: ThemeMode.light;
|
||||
}
|
||||
|
||||
notifyListeners();
|
||||
|
||||
return I;
|
||||
|
||||
Reference in New Issue
Block a user