toggleTheme method

void toggleTheme()

Toggles between light and dark themes.

If current theme is light, switches to dark and vice versa.

Implementation

void toggleTheme() {
  final newValue =
      currentMode.value == ThemeMode.light ? ThemeMode.dark : ThemeMode.light;

  runInAction(() => currentMode.value = newValue);
}