title: Is there a way I could refactor these similar functions in dart?
body: <p>I'm trying to set the state of the variables using provider state management in Flutter, so when I call the provider in my build, it's going to change the state of the booleans in my provider class.</p>
  <p>The problem now is most of the function in the provider are doing basically the same thing, since they are just changing the value of the boolean to the opposite.</p>
  <p>I've been looking for a way to make the code shorter since the functions are doing basically the same thing. I've been wrapping my head around the whole thing but I can't come up with anything, and having this spaghetti mess of code hurts my eyes:</p>
  <pre><code>class AlarmState extends ChangeNotifier {
    var hour = 0;
    var min = 0;
    bool isWednesday = false;
    bool isMonday = false;
    bool isTuesday = false;
    bool isThursday = false;
    bool isFriday = false;
    bool isSaturday = false;
    bool isSunday = false;
    bool alarmRing = false;
    bool vibrate = false;
    bool snooze = false;
    List&lt;AlarmObject&gt; alarmList = [];
    bool isAlarmOn = true;
  
    void handleChangeHour(int index) {
      hour = index;
      notifyListeners();
    }
  
    void handleChangeMin(int index) {
      min = index;
      notifyListeners();
    }
  
    void changeMonday() {
      isMonday = !isMonday;
      notifyListeners();
    }
  
    void changeTuesday() {
      isTuesday = !isTuesday;
      notifyListeners();
    }
  
    void changeWednesday() {
      isWednesday = !isWednesday;
      notifyListeners();
    }
  
    void changeThursday() {
      isThursday = !isThursday;
      notifyListeners();
    }
  
    void changeFriday() {
      isFriday = !isFriday;
      notifyListeners();
    }
  
    void changeSaturday() {
      isSaturday = !isSaturday;
      notifyListeners();
    }
  
    void changeSunday() {
      isSunday = !isSunday;
      notifyListeners();
    }
  
    void handleAlarmRing(value) {
      alarmRing = value;
      notifyListeners();
    }
  
    void handleSnooze(value) {
      snooze = value;
      notifyListeners();
    }
  
    void handleVibrate(value) {
      vibrate = value;
      notifyListeners();
    }
  
    void handleIsAlarmOn(bool value) {
      isAlarmOn = value;
      print(isAlarmOn);
      notifyListeners();
    }
  }
  </code></pre>