changeTheme method

dynamic changeTheme(
  1. ThemeData newTheme, {
  2. bool turnOffDynamicThemeChange = false,
})

Manually change the theme of the app If you don't wish to change the theme at sunset / sunrise time set the turnOffDynamicThemeChange to true

Implementation

changeTheme(ThemeData newTheme, {bool turnOffDynamicThemeChange = false}) {
  _selectedTheme = newTheme;
  notifyListeners();
  if (turnOffDynamicThemeChange) {
    _timer?.cancel();
  }
}