mirror of
https://github.com/hanskokx/arcane_framework.git
synced 2026-05-14 02:19:08 +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
|
/// ```dart
|
||||||
/// ArcaneReactiveTheme.I.switchTheme();
|
/// ArcaneReactiveTheme.I.switchTheme();
|
||||||
/// ```
|
/// ```
|
||||||
ArcaneReactiveTheme switchTheme() {
|
ArcaneReactiveTheme switchTheme({ThemeMode? themeMode}) {
|
||||||
_systemThemeNotifier.value = _systemThemeNotifier.value == ThemeMode.light
|
if (themeMode != null) {
|
||||||
? ThemeMode.dark
|
_systemThemeNotifier.value = themeMode;
|
||||||
: ThemeMode.light;
|
} else {
|
||||||
|
_systemThemeNotifier.value = _systemThemeNotifier.value == ThemeMode.light
|
||||||
|
? ThemeMode.dark
|
||||||
|
: ThemeMode.light;
|
||||||
|
}
|
||||||
|
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
|
|
||||||
return I;
|
return I;
|
||||||
|
|||||||
Reference in New Issue
Block a user