setTheme method
Set the theme to use by giving the index
to use. This will notify the app to automatically switch the theme and will persist the current theme to use in the shared perferences.
Implementation
Future<void> setTheme(int index) async {
Logger(TAG).info("Set theme index to $index");
currentThemeIndex = index;
await EzSettings.updateSp(EzSettingsKeys.KEY_EZ_CURRENT_THEME, index);
notifyListeners();
}